Skip to content

Commit 51ebd8a

Browse files
committed
unknown: This is awful
1 parent 0277e00 commit 51ebd8a

File tree

8 files changed

+825
-180
lines changed

8 files changed

+825
-180
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

main.tf

Lines changed: 124 additions & 139 deletions
Large diffs are not rendered by default.

modules/service/README.md

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

modules/service/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ data "aws_iam_policy_document" "tasks" {
11531153
}
11541154

11551155
dynamic "condition" {
1156-
for_each = statement.value.conditions != null ? statement.value.conditions : []
1156+
for_each = statement.value.condition != null ? statement.value.condition : []
11571157

11581158
content {
11591159
test = condition.value.test
@@ -1177,7 +1177,7 @@ resource "aws_iam_policy" "tasks" {
11771177
}
11781178

11791179
resource "aws_iam_role_policy_attachment" "tasks" {
1180-
count = local.create_tasks_iam_role && (length(var.tasks_iam_role_statements) > 0 || var.enable_execute_command) ? 1 : 0
1180+
count = local.create_tasks_iam_role && (var.tasks_iam_role_statements != null || var.enable_execute_command) ? 1 : 0
11811181

11821182
role = aws_iam_role.tasks[0].name
11831183
policy_arn = aws_iam_policy.tasks[0].arn

modules/service/variables.tf

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,6 @@ variable "triggers" {
270270
default = null
271271
}
272272

273-
variable "wait_for_steady_state" {
274-
description = "If true, Terraform will wait for the service to reach a steady state before continuing. Default is `false`"
275-
type = bool
276-
default = null
277-
}
278-
279273
variable "volume_configuration" {
280274
description = "Configuration for a volume specified in the task definition as a volume that is configured at launch time"
281275
type = object({
@@ -309,6 +303,12 @@ variable "vpc_lattice_configurations" {
309303
default = null
310304
}
311305

306+
variable "wait_for_steady_state" {
307+
description = "If true, Terraform will wait for the service to reach a steady state before continuing. Default is `false`"
308+
type = bool
309+
default = null
310+
}
311+
312312
variable "service_tags" {
313313
description = "A map of additional tags to add to the service"
314314
type = map(string)
@@ -412,7 +412,6 @@ variable "task_definition_arn" {
412412
variable "container_definitions" {
413413
description = "A map of valid [container definitions](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html). Please note that you should only provide values that are part of the container definition document"
414414
type = map(object({
415-
region = optional(string)
416415
enable_execute_command = optional(bool, false)
417416
operating_system_family = optional(string, "LINUX")
418417
tags = optional(map(string), {})
@@ -556,7 +555,6 @@ variable "container_definitions" {
556555
variable "container_definition_defaults" {
557556
description = "A map of default values for [container definitions](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html) created by `container_definitions`"
558557
type = map(object({
559-
region = optional(string)
560558
enable_execute_command = optional(bool, false)
561559
operating_system_family = optional(string, "LINUX")
562560
tags = optional(map(string), {})
@@ -747,15 +745,6 @@ variable "pid_mode" {
747745
default = null
748746
}
749747

750-
variable "task_definition_placement_constraints" {
751-
description = "Configuration block for rules that are taken into consideration during task placement (up to max of 10). This is set at the task definition, see `placement_constraints` for setting at the service"
752-
type = map(object({
753-
expression = optional(string)
754-
type = string
755-
}))
756-
default = null
757-
}
758-
759748
variable "proxy_configuration" {
760749
description = "Configuration block for the App Mesh proxy"
761750
type = object({
@@ -790,6 +779,15 @@ variable "skip_destroy" {
790779
default = null
791780
}
792781

782+
variable "task_definition_placement_constraints" {
783+
description = "Configuration block for rules that are taken into consideration during task placement (up to max of 10). This is set at the task definition, see `placement_constraints` for setting at the service"
784+
type = map(object({
785+
expression = optional(string)
786+
type = string
787+
}))
788+
default = null
789+
}
790+
793791
variable "track_latest" {
794792
description = "Whether should track latest `ACTIVE` task definition on AWS or the one created with the resource stored in state. Default is `false`. Useful in the event the task definition is modified outside of this resource"
795793
type = bool
@@ -911,13 +909,13 @@ variable "create_task_exec_policy" {
911909
variable "task_exec_ssm_param_arns" {
912910
description = "List of SSM parameter ARNs the task execution role will be permitted to get/read"
913911
type = list(string)
914-
default = ["arn:aws:ssm:*:*:parameter/*"]
912+
default = []
915913
}
916914

917915
variable "task_exec_secret_arns" {
918916
description = "List of SecretsManager secret ARNs the task execution role will be permitted to get/read"
919917
type = list(string)
920-
default = ["arn:aws:secretsmanager:*:*:secret:*"]
918+
default = []
921919
}
922920

923921
variable "task_exec_iam_statements" {
@@ -1145,9 +1143,6 @@ variable "autoscaling_policies" {
11451143
scale_out_cooldown = optional(number, 60)
11461144
target_value = optional(number, 75)
11471145
}))
1148-
1149-
1150-
11511146
default = {
11521147
cpu = {
11531148
policy_type = "TargetTrackingScaling"
@@ -1225,7 +1220,7 @@ variable "security_group_ingress_rules" {
12251220
tags = optional(map(string), {})
12261221
to_port = optional(string)
12271222
}))
1228-
default = null
1223+
default = {}
12291224
}
12301225

12311226
variable "security_group_egress_rules" {
@@ -1241,7 +1236,7 @@ variable "security_group_egress_rules" {
12411236
tags = optional(map(string), {})
12421237
to_port = optional(string)
12431238
}))
1244-
default = null
1239+
default = {}
12451240
}
12461241

12471242
variable "security_group_tags" {
@@ -1251,7 +1246,7 @@ variable "security_group_tags" {
12511246
}
12521247

12531248
############################################################################################
1254-
# ECS infrastructure IAM role
1249+
# ECS Infrastructure IAM role
12551250
############################################################################################
12561251

12571252
variable "create_infrastructure_iam_role" {

0 commit comments

Comments
 (0)