-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
70 lines (62 loc) · 1.84 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
68
69
70
terraform {
required_version = ">= 1.9.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.78.0"
}
}
}
provider "aws" {
region = "ap-southeast-1"
alias = "singapore"
}
provider "aws" {
region = "eu-central-1"
alias = "frankfurt"
}
module "iam" {
source = "./common/iam"
env = var.env
providers = {
aws = aws.singapore
}
}
module "main_cluster" {
source = "./clusters"
zone_id = "0"
env = var.env
keypair_name = var.keypair_name
container_image = var.container_image
media_instance_type = var.media_instance_type
standard_instance_type = var.standard_instance_type
cluster_secret = var.cluster_secret
cidr_block = "10.0.0.0/16"
console_endpoint = null
is_primary_cluster = true
ecs_execution_role_arn = module.iam.ecs_execution_role_arn
ecs_instance_role_profile = module.iam.ecs_instance_role_profile
depends_on = [module.iam]
providers = {
aws = aws.singapore
}
}
module "sub_cluster_1" {
source = "./clusters"
zone_id = "1"
env = var.env
keypair_name = var.keypair_name
container_image = var.container_image
media_instance_type = var.media_instance_type
standard_instance_type = var.standard_instance_type
cluster_secret = var.cluster_secret
cidr_block = "10.1.0.0/16"
console_endpoint = module.main_cluster.console_domain
is_primary_cluster = false
ecs_execution_role_arn = module.iam.ecs_execution_role_arn
ecs_instance_role_profile = module.iam.ecs_instance_role_profile
depends_on = [module.main_cluster]
providers = {
aws = aws.frankfurt
}
}