File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ module "app_cluster" {
25
25
instance_type = "t3a.medium"
26
26
user_data_base64 = ""
27
27
iam_instance_profile_name = "ecs_agent_access_instance_profile"
28
+ root_block_device = {
29
+ volume_type = "gp3"
30
+ volume_size = 30
31
+ }
28
32
security_group_ids = ["sg-01", "sg-02"]
29
33
},
30
34
{
@@ -164,7 +168,7 @@ No modules.
164
168
| launch_configs.user_data_base64 | Base64 encoded userdata. | ` string ` | n/a | yes |
165
169
| launch_configs.iam_instance_profile_name | Name of the IAM instance profile to attach to the EC2 instance. | ` string ` | n/a | yes |
166
170
| launch_configs.security_group_ids | List of security group ids to attach to the EC2 instance. | ` list(string) ` | n/a | yes |
167
-
171
+ | launch_configs.root_block_device | root block device configuration
168
172
169
173
### Outputs
170
174
No outputs.
Original file line number Diff line number Diff line change @@ -5,7 +5,16 @@ 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
- security_groups = each. value . security_group_ids
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
+ }
17
+ security_groups = each. value . security_group_ids
9
18
lifecycle {
10
19
create_before_destroy = true
11
20
}
Original file line number Diff line number Diff line change @@ -40,7 +40,11 @@ variable "launch_configs" {
40
40
instance_type = string
41
41
user_data_base64 = string
42
42
iam_instance_profile_name = string
43
- security_group_ids = list (string )
43
+ root_block_device = object ({
44
+ volume_type = string
45
+ volume_size = number
46
+ })
47
+ security_group_ids = list (string )
44
48
}))
45
49
description = " Launch configuration for EC2 instances."
46
50
}
You can’t perform that action at this time.
0 commit comments