8000 refactor(modules/asg): add nullable flags to variables · infraspecdev/terraform-aws-ecs@8845b37 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8845b37

Browse files
committed
refactor(modules/asg): add nullable flags to variables
Reorder certain variables.
1 parent e5166ea commit 8845b37

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

modules/asg/variables.tf

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
variable "cluster_name" {
22
description = "Name of the ECS Cluster to associate with the Autoscaling Group"
33
type = string
4+
nullable = false
45
}
56

67
variable "name" {
@@ -12,6 +13,7 @@ variable "name" {
1213
variable "vpc_zone_identifier" {
1314
description = "(Optional) List of subnet IDs to launch resources in."
1415
type = list(string)
16+
nullable = false
1517
default = []
1618
}
1719

@@ -33,31 +35,42 @@ variable "max_size" {
3335
variable "protect_from_scale_in" {
3436
description = " (Optional) Whether newly launched instances are automatically protected from termination by Amazon EC2 Auto Scaling when scaling in."
3537
type = bool
38+
nullable = false
3639
default = false
3740
}
3841

3942
variable "health_check_type" {
4043
description = "(Optional) \"EC2\" or \"ELB\". Controls how health checking is done."
4144
type = string
45+
nullable = false
4246
default = "EC2"
4347
}
4448

4549
variable "instances_tags" {
4650
description = "Resources Tags to propagate to the Instances"
4751
type = map(string)
52+
nullable = false
4853
default = {}
4954
}
5055

5156
variable "tags" {
5257
description = "Resources Tags for Autoscaling group"
5358
type = map(string)
59+
nullable = false
5460
default = {}
5561
}
5662

5763
################################################################################
5864
# Launch Template
5965
################################################################################
6066

67+
variable "create_launch_template" {
68+
description = "Either to create a Launch Template to associate with the Autoscaling group"
69+
type = bool
70+
nullable = false
71+
default = true
72+
}
73+
6174
variable "launch_template" {
6275
description = "Launch Template to use with the Autoscaling group"
6376
type = object({
@@ -80,13 +93,8 @@ variable "launch_template" {
8093
user_data = optional(string, null)
8194
tags = optional(map(string), {})
8295
})
83-
default = {}
84-
}
85-
86-
variable "create_launch_template" {
87-
description = "Either to create a Launch Template to associate with the Autoscaling group"
88-
type = bool
89-
default = true
96+
nullable = false
97+
default = {}
9098
}
9199

92100
variable "launch_template_id" {
@@ -114,6 +122,7 @@ variable "iam_role_name" {
114122
variable "iam_role_policy_attachments" {
115123
description = "(Required) - The ARN of the policy you want to apply"
116124
type = list(string)
125+
nullable = false
117126
default = [
118127
"arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"
119128
]
@@ -122,6 +131,7 @@ variable "iam_role_policy_attachments" {
122131
variable "iam_role_tags" {
123132
description = "Key-value mapping of tags for the IAM role."
124133
type = map(string)
134+
nullable = false
125135
default = {}
126136
}
127137

@@ -138,5 +148,6 @@ variable "iam_instance_profile_name" {
138148
variable "iam_instance_profile_tags" {
139149
description = "(Optional) Map of resource tags for the IAM Instance Profile."
140150
type = map(string)
151+
nullable = false
141152
default = {}
142153
}

0 commit comments

Comments
 (0)
0