Skip to content

Commit

Permalink
Use SSM to pull AMI ID dynamically in launch template, instead of par…
Browse files Browse the repository at this point in the history
…ameter fetched on TF apply
  • Loading branch information
jemnery committed Oct 23, 2024
1 parent b0f8bbb commit feb4ebd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions terraform/environments/performance-hub/module/ecs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ data "aws_lb_target_group" "target_group" {
}
}

data "aws_ssm_parameter" "ecs_optimized_ami" {
name = "/aws/service/ami-windows-latest/Windows_Server-2019-English-Full-ECS_Optimized"
}

resource "aws_autoscaling_group" "cluster-scaling-group" {
vpc_zone_identifier = sort(data.aws_subnets.shared-private.ids)
desired_capacity = var.ec2_desired_capacity
Expand Down Expand Up @@ -99,7 +95,7 @@ resource "aws_security_group" "cluster_ec2" {
}

# EC2 launch template - settings to use for new EC2s added to the group
# Note - when updating this you will need to manually terminate the EC2s
# Note - to force a new AMI you will need to manually terminate the EC2s
# so that the autoscaling group creates new ones using the new launch template

resource "aws_launch_template" "ec2-launch-template" {
Expand Down

0 comments on commit feb4ebd

Please sign in to comment.