-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.tf
68 lines (61 loc) · 1.97 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
provider "aws" {
shared_credentials_file = "$HOME/.aws/credentials"
profile = "default"
region = var.region
}
module "registry" {
source = "./modules/registry"
app_name = var.app_name
environment = var.environment
}
module "network" {
source = "./modules/network"
environment = var.environment
vpc_cidr = var.vpc_cidr
region = var.region
az_count = var.az_count
}
module "fargate" {
source = "./modules/fargate"
environment = var.environment
app_name = var.app_name
app_port = var.app_port
app_image = "${module.registry.repository_uri}:latest"
scale_min = var.scale_min
scale_max = var.scale_max
region = var.region
base_domain = var.base_domain
fargate_cpu = var.fargate_cpu
fargate_memory = var.fargate_memory
use_ssl = var.use_ssl
app_count = var.app_count
deploy_min_t = var.deploy_min_t
deploy_max_t = var.deploy_max_t
health_check_path = var.health_check_path
vpc_id = module.network.vpc_id
public_subnet = module.network.subnet_pub
private_subnet = module.network.subnet_prv
}
module "buildndeploy" {
source = "./modules/buildndeploy"
environment = var.environment
region = var.region
registry_uri = module.registry.repository_uri
repository_owner = var.repository_owner
repository_name = var.repository_name
repository_branch = var.repository_branch
ecs_cluster_name = module.fargate.cluster_name
ecs_service_name = module.fargate.service_name
task_subnet_id = module.network.subnet_prv
task_secgrp_id = module.fargate.task_secgrp_id
github_token = var.github_token
}
module "hostname" {
source = "./modules/ns"
app_name = var.app_name
alb_url = module.fargate.alb_hostname
base_domain = var.base_domain
}
output "app_hn" {
value = module.hostname.name
}