diff --git a/main.tf b/main.tf index 4c43b9e..bae8bf2 100644 --- a/main.tf +++ b/main.tf @@ -122,24 +122,23 @@ data "aws_ami" "latest_ecs" { } data "aws_ami" "ubuntu" { - most_recent = true - owners = ["099720109477"] + most_recent = true + owners = ["099720109477"] # Cannonical / Ubuntu - # Ubuntu AMI ID search - filter { - name = "name" - values = ["ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*"] - } + filter { + name = "name" + values = ["ubuntu/images/hvm-ssd/ubuntu-focal-24.04-amd64-server-*"] + } + + filter { + name = "virtualization-type" + values = ["hvm"] + } - filter { - name = "virtualization-type" - values = ["hvm"] - } } resource "aws_instance" "ubuntu_instance" { - ami = data.aws_ami.ubuntu.id - # Ubuntu "ami-0a0e5d9c7acc336f1" + ami = data.aws_ami.ubuntu.ami # Ubuntu "ami-0a0e5d9c7acc336f1" # ami = data.aws_ami.latest_ecs.ami # Amazon Linux instance_type = var.instance_size subnet_id = aws_subnet.public_subnet.id diff --git a/outputs.tf b/outputs.tf index 3c89d36..8ff0178 100644 --- a/outputs.tf +++ b/outputs.tf @@ -6,7 +6,6 @@ output "ubuntu_ami" { output "private_key" { value = tls_private_key.ssh_key.private_key_pem description = "SSH Private Key (PEM format)" - sensitive = true } output "public_key" { diff --git a/variables.tf b/variables.tf index 4aa841a..efe3bf9 100644 --- a/variables.tf +++ b/variables.tf @@ -44,11 +44,9 @@ variable "aws_region" { variable "aws_access_key" { description = "AWS Access Key" type = string - sensitive = true } variable "aws_secret_key" { description = "AWS Secret Key" type = string - sensitive = true }