Skip to content

Commit

Permalink
updated template to use dynamic resolution of SSM parameter store value
Browse files Browse the repository at this point in the history
  • Loading branch information
dms1981 committed Oct 11, 2024
1 parent 72b6469 commit 7acb479
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -379,22 +379,6 @@ resource "aws_iam_instance_profile" "bastion_profile" {
}

## Bastion

data "aws_ami" "linux_2_image" {
most_recent = true
owners = ["amazon"]

filter {
name = "name"
values = ["amzn2-ami-hvm*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}
}

resource "aws_launch_template" "bastion_linux_template" {
name = "${var.instance_name}_template"

Expand All @@ -413,7 +397,7 @@ resource "aws_launch_template" "bastion_linux_template" {
name = aws_iam_instance_profile.bastion_profile.id
}

image_id = data.aws_ami.linux_2_image.id
image_id = "resolve:ssm:/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
instance_initiated_shutdown_behavior = "terminate"
instance_type = "t3.micro"

Expand Down

0 comments on commit 7acb479

Please sign in to comment.