1
1
variable "cluster_name" {
2
2
description = " (Required) Name of the cluster"
3
3
type = string
4
+ nullable = false
4
5
}
5
6
6
7
variable "cluster_service_connect_namespace" {
@@ -15,12 +16,14 @@ variable "cluster_setting" {
15
16
name = string
16
17
value = string
17
18
}))
18
- default = []
19
+ nullable = false
20
+ default = []
19
21
}
20
22
21
23
variable "cluster_tags" {
22
24
description = " (Optional) Key-value map of resource tags."
23
25
type = map (string )
26
+ nullable = false
24
27
default = {}
25
28
}
26
29
@@ -31,11 +34,14 @@ variable "cluster_tags" {
31
34
variable "asg_name" {
32
35
description = " (Optional) Name of the Auto Scaling Group."
33
36
type = string
37
+ default = null
34
38
}
35
39
36
40
variable "asg_vpc_zone_identifier" {
37
41
description = " (Optional) List of subnet IDs to launch resources in."
38
42
type = list (string )
43
+ nullable = false
44
+ default = []
39
45
40
46
validation {
41
47
condition = alltrue ([for subnet_id in var . asg_vpc_zone_identifier : startswith (subnet_id, " subnet-" )])
@@ -48,7 +54,7 @@ variable "asg_desired_capacity" {
48
54
type = number
49
55
50
56
validation {
51
- condition = var. asg_desired_capacity >= 0
57
+ condition = try ( var. asg_desired_capacity >= 0 , true )
52
58
error_message = " Specified desired capacity must be a valid non-negative number."
53
59
}
54
60
}
@@ -58,7 +64,7 @@ variable "asg_min_size" {
58
64
type = number
59
65
60
66
validation {
61
- condition = var. asg_min_size >= 0
67
+ condition = try ( var. asg_min_size >= 0 , true )
62
68
error_message = " Specified min. size must be a valid non-negative number."
63
69
}
64
70
}
@@ -68,39 +74,50 @@ variable "asg_max_size" {
68
74
type = number
69
75
70
76
validation {
71
- condition = var. asg_max_size >= 0
77
+ condition = try ( var. asg_max_size >= 0 , null )
72
78
error_message = " Specified max. size must be a valid non-negative number."
73
79
}
74
80
}
75
81
76
82
variable "asg_protect_from_scale_in" {
77
83
description = " (Optional) Whether newly launched instances are automatically protected from termination by Amazon EC2 Auto Scaling when scaling in."
78
84
type = bool
79
- default = null
85
+ nullable = false
86
+ default = false
80
87
}
81
88
82
89
variable "asg_health_check_type" {
83
90
description = " (Optional) \" EC2\" or \" ELB\" . Controls how health checking is done."
84
91
type = string
85
- default = null
92
+ nullable = false
93
+ default = " EC2"
86
94
}
87
95
88
96
variable "asg_instances_tags" {
89
97
description = " Resources Tags to propagate to the Instances"
90
98
type = map (string )
99
+ nullable = false
91
10
EDBE
0
default = {}
92
101
}
93
102
94
103
variable "asg_tags" {
95
104
description = " Resources Tags for Autoscaling group"
96
105
type = map (string )
106
+ nullable = false
97
107
default = {}
98
108
}
99
109
100
110
# ###############################################################################
101
111
# ## Launch Template
102
112
# ###############################################################################
103
113
114
+ variable "asg_create_launch_template" {
115
+ description = " Either to create a Launch Template to associate with the Autoscaling group"
116
+ type = bool
117
+ nullable = false
118
+ default = true
119
+ }
120
+
104
121
variable "asg_launch_template" {
105
122
description = " Launch Template to use with the Autoscaling group"
106
123
type = object ({
@@ -123,13 +140,8 @@ variable "asg_launch_template" {
123
140
user_data = optional (string , null )
124
141
tags = optional (map (string ), {})
125
142
})
126
- default = {}
127
- }
128
-
129
- variable "asg_create_launch_template" {
130
- description = " Either to create a Launch Template to associate with the Autoscaling group"
131
- type = bool
132
- default = true
143
+ nullable = false
144
+ default = {}
133
145
}
134
146
135
147
variable "asg_launch_template_id" {
@@ -146,7 +158,7 @@ variable "asg_launch_template_id" {
146
158
variable "asg_launch_template_version" {
147
159
description = " (Optional) Template version."
148
160
type = string
149
- default = null
161
+ default = " $Default "
150
162
}
151
163
152
164
# ###############################################################################
@@ -160,8 +172,9 @@ variable "asg_iam_role_name" {
160
172
}
161
173
162
174
variable "asg_iam_role_policy_attachments" {
163
- description = " (Required ) - The ARN of the policy you want to apply"
175
+ description = " (Optional ) - The ARNs of the policies you want to apply"
164
176
type = list (string )
177
+ nullable = false
165
178
default = [
166
179
" arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"
167
180
]
@@ -170,6 +183,7 @@ variable "asg_iam_role_policy_attachments" {
170
183
variable "asg_iam_role_tags" {
171
184
description = " Key-value mapping of tags for the IAM role."
172
185
type = map (string )
186
+ nullable = false
173
187
default = {}
174
188
}
175
189
@@ -186,5 +200,6 @@ variable "asg_iam_instance_profile_name" {
186
200
variable "asg_iam_instance_profile_tags" {
187
201
description = " (Optional) Map of resource tags for the IAM Instance Profile."
188
202
type = map (string )
203
+ nullable = false
189
204
default = {}
190
205
}
0 commit comments