Skip to content

Commit cb9c8c3

Browse files
committed
add root_block_device to launch configs
1 parent 195878e commit cb9c8c3

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ 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+
tags = {
32+
"Environment" = "staging"
33+
"ManagedBy" = "Terraform"
34+
}
35+
}
2836
security_group_ids = ["sg-01", "sg-02"]
2937
},
3038
{

auto_scaling_groups.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ 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+
root_block_device = each.value.root_block_device || {}
89
security_groups = each.value.security_group_ids
910
lifecycle {
1011
create_before_destroy = true

variables.tf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ 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+
ebs_volume_type = string
45+
ebs_volume_size = number
46+
tags = object({
47+
Name = string
48+
Environment = string
49+
ManagedBy = string
50+
})
51+
})
52+
security_group_ids = list(string)
4453
}))
4554
description = "Launch configuration for EC2 instances."
4655
}

0 commit comments

Comments
 (0)