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" {
2525 instance_type = "t3a.medium"
2626 user_data_base64 = ""
2727 iam_instance_profile_name = "ecs_agent_access_instance_profile"
28+ root_block_device = {
29+ volume_type = "gp3"
30+ volume_size = 30
31+ }
2832 security_group_ids = ["sg-01", "sg-02"]
2933 },
3034 {
@@ -164,7 +168,7 @@ No modules.
164168| launch_configs.user_data_base64 | Base64 encoded userdata. | ` string ` | n/a | yes |
165169| launch_configs.iam_instance_profile_name | Name of the IAM instance profile to attach to the EC2 instance. | ` string ` | n/a | yes |
166170| 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
168172
169173### Outputs
170174No outputs.
Original file line number Diff line number Diff line change @@ -5,7 +5,16 @@ resource "aws_launch_configuration" "ecs_launch_config" {
55 instance_type = each. value . instance_type
66 user_data_base64 = each. value . user_data_base64
77 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
918 lifecycle {
1019 create_before_destroy = true
1120 }
Original file line number Diff line number Diff line change @@ -40,7 +40,11 @@ variable "launch_configs" {
4040 instance_type = string
4141 user_data_base64 = string
4242 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 )
4448 }))
4549 description = " Launch configuration for EC2 instances."
4650}
You can’t perform that action at this time.
0 commit comments