forked from madagra/terraform-aws-single-task-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
151 lines (125 loc) · 3.84 KB
/
variables.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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# ========= input variables ==========
variable "task_name" {
description = "The task name which gives the name to the ECS task, container and service discovery name"
type = string
}
variable "container_image" {
description = "The Docker image to run with the task"
type = string
}
variable "ecs_cluster" {
description = "The ECS cluster ID where the service should run"
type = string
}
variable "vpc_id" {
description = "The ID of the VPC where the ECS cluster is running"
type = string
}
variable "vpc_subnets" {
description = "The VPC subnets where the application should run"
type = list(string)
}
variable "vpc_cidr" {
description = "The trusted VPC CIDR to assign to the task security group ingress block"
type = list(string)
default = ["0.0.0.0/0"]
}
variable "task_exec_role" {
description = "The IAM role which is assumed by the ECS tasks"
type = string
}
variable "task_launch_type" {
description = "The launch type for the ECS task. Choose between EC2 and FARGATE"
type = string
default = "EC2"
}
variable "task_network_mode" {
description = "The network mode for the ECS task"
type = string
default = "awsvpc"
}
variable "has_discovery" {
description = "Flag to switch on service discovery. If true, a valid DNS namespace must be provided"
type = bool
default = false
}
variable "dns_namespace" {
description = "The Route53 DNS namespace where the ECS task is registered"
type = string
default = null
}
variable "open_ports" {
description = "The ports which should be opened in the container and the security group to allow communication among services"
type = list(string)
default = []
}
variable "has_alb" {
description = "Whether the service should be registered to an application load balancer"
type = bool
default = false
}
variable "alb_port" {
description = "If load balanced service this is the application port for the target group"
type = number
default = 0
}
variable "alb_target_group" {
description = "If the service is associated with an application load balancer this is the ALB target group"
type = string
default = null
}
variable "has_asg" {
description = "Whether the service is associated with an autoscaling group of EC2 instances"
type = bool
default = false
}
variable "capacity_provider" {
description = "The capacity provider name for the autoscaling group"
type = string
default = null
}
variable "has_logs" {
description = "Whether to forward logging to CloudWatch"
type = bool
default = false
}
variable "logs_region" {
description = "The region where the CloudWatch logs group is created"
type = string
default = null
}
variable "task_cpu" {
description = "The CPU percentage allocated for the ECS task in vCPU units"
type = number
default = 512
}
variable "task_memory" {
description = "The memory allocated for the ECS task in Mb"
type = number
default = 512
}
variable "environment" {
description = "The container environmental variables"
type = list(map(string))
default = []
}
variable "security_groups" {
description = "Additional security groups to assign to the ECS service"
type = list(string)
default = []
}
variable "desired_count" {
description = "The desired number of the ECS task to run"
type = number
default = 1
}
variable "deployment_maximum_percent" {
description = "The maximum number of tasks which can run during redeployment of the service"
type = number
default = 100
}
variable "deployment_minimum_healthy_percent" {
description = "The minimum percentage of running tasks to consider the service healthy"
type = number
default = 50
}