-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterragrunt.hcl
111 lines (95 loc) · 2.29 KB
/
terragrunt.hcl
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
locals {
account_id = get_aws_account_id()
project_name = "wp-on-aws"
region = "eu-west-1"
environment = "dev"
common_tags = {
"Project" = local.project_name
"CreatedBy" = "Terraform"
"ManagedBy" = "Terraform"
"Environment" = local.environment
}
name_prefix = lower("${local.environment}-${local.project_name}")
}
remote_state {
backend = "s3"
config = {
bucket = "${local.name_prefix}-${local.region}-${local.account_id}-terraform-state"
key = "${path_relative_to_include()}/terraform.tfstate"
region = local.region
encrypt = true
dynamodb_table = "${local.name_prefix}-terraform-state-locks"
}
}
generate "backend" {
path = "backend.tf"
if_exists = "skip"
contents = <<EOF
terraform {
backend "s3" {
}
}
EOF
}
generate "provider" {
path = "providers.tf"
if_exists = "skip"
contents = <<EOF
provider "aws" {
region = var.region
}
EOF
}
generate "versions" {
path = "versions.tf"
if_exists = "skip"
contents = <<EOF
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
required_version = ">= 0.14"
}
EOF
}
inputs = {
region = local.region
account_id = get_aws_account_id()
environment = local.environment
common_tags = local.common_tags
name_prefix = local.name_prefix
vpc_cidr = "10.0.0.0/16"
public_subnets = [
"10.0.0.0/22",
"10.0.4.0/22",
"10.0.8.0/22"
]
private_subnets = [
"10.0.32.0/21",
"10.0.40.0/21",
"10.0.48.0/21"
]
database_subnets = [
"10.0.64.0/23",
"10.0.66.0/23",
"10.0.68.0/23"
]
db_min_capacity = 1
db_max_capacity = 4
db_autopause = false
db_autopause_after_seconds = 3600
task_cpu = 1024
task_memory = 2048
task_desired_count = 3
log_retention_in_days = 30
container_image_url = "wordpress:5.7.0-php7.3-apache"
container_name = "wordpress"
container_port = 80
ecs_service_autoscaling_min_capacity = 1
ecs_service_autoscaling_max_capacity = 30
ecs_service_autoscaling_cpu_average_utilization_target = 75
ecs_service_autoscaling_scale_in_cooldown = 300
ecs_service_autoscaling_scale_out_cooldown = 300
}