File tree Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,6 @@ module "app_cluster" {
28
28
root_block_device = {
29
29
volume_type = "gp3"
30
30
volume_size = 30
31
- tags = {
32
- "Environment" = "staging"
33
- "ManagedBy" = "Terraform"
34
- }
35
31
}
36
32
security_group_ids = ["sg-01", "sg-02"]
37
33
},
@@ -172,7 +168,7 @@ No modules.
172
168
| launch_configs.user_data_base64 | Base64 encoded userdata. | ` string ` | n/a | yes |
173
169
| launch_configs.iam_instance_profile_name | Name of the IAM instance profile to attach to the EC2 instance. | ` string ` | n/a | yes |
174
170
| launch_configs.security_group_ids | List of security group ids to attach to the EC2 instance. | ` list(string) ` | n/a | yes |
175
-
171
+ | launch_configs.root_block_device | root block device configuration
176
172
177
173
### Outputs
178
174
No outputs.
Original file line number Diff line number Diff line change @@ -5,7 +5,15 @@ resource "aws_launch_configuration" "ecs_launch_config" {
5
5
instance_type = each. value . instance_type
6
6
user_data_base64 = each. value . user_data_base64
7
7
iam_instance_profile = each. value . iam_instance_profile_name
8
- root_block_device = each. value . root_block_device || {}
8
+
9
+ dynamic "root_block_device" {
10
+ for_each = each. value . root_block_device != null ? [each . value . root_block_device ] : []
11
+
12
+ content {
13
+ volume_type = root_block_device. value . volume_type
14
+ volume_size = root_block_device. value . volume_size
15
+ }
16
+ }
9
17
security_groups = each. value . security_group_ids
10
18
lifecycle {
11
19
create_before_destroy = true
Original file line number Diff line number Diff line change @@ -41,13 +41,8 @@ variable "launch_configs" {
41
41
user_data_base64 = string
42
42
iam_instance_profile_name = string
43
43
root_block_device = object ({
44
- ebs_volume_type = string
45
- ebs_volume_size = number
46
- tags = object ({
47
- Name = string
48
- Environment = string
49
- ManagedBy = string
50
- })
44
+ volume_type = string
45
+ volume_size = number
51
46
})
52
47
security_group_ids = list (string )
53
48
}))
You can’t perform that action at this time.
0 commit comments