Skip to content

Commit

Permalink
Fixed broken ami retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
sradzhabov committed Sep 24, 2024
1 parent d71e291 commit 8bb391f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion aws/terraform/compute/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
# sshpub_key = var.ec2_sshpub_key
#}

# Get latest Amazon Linux 2 AMI
data "aws_ami" "amazon-linux-2" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
values = ["amzn2-ami-hvm*"]
}
}

resource "aws_instance" "ec2_server" {
ami = "ami-04e914639d0cca79a"
ami = data.aws_ami.amazon-linux-2.id
instance_type = var.ec2_size
subnet_id = var.ec2_subnet_id
# root disk
Expand Down

0 comments on commit 8bb391f

Please sign in to comment.