-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
30 lines (26 loc) · 812 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module "terraform_state_backend" {
source = "cloudposse/tfstate-backend/aws"
version = "0.33.0"
namespace = "infra-study"
stage = var.env
name = "tf"
attributes = ["state"]
terraform_backend_config_file_path = "."
terraform_backend_config_file_name = "backend.tf"
force_destroy = false
}
module "networking" {
source = "./modules/networking"
}
module "instance" {
source = "./modules/instance"
ssh_key = var.instance_key_file
user = var.instance_user
instance_ami = var.instance_ami
ec2_sg_id = module.networking.ec2_sg_id
}
module "application" {
source = "./modules/application"
image = var.image
host = "ssh://${var.instance_user}@${module.instance.public_ip}:22"
}