terraform plan shows the same change every single run
Why does terraform want to replace this EC2 instance on every plan? Terraform 1.6.6, AWS provider 5.31.0. The instance uses ami = data.aws_ami.ubuntu.id with most_recent = true and a name filter ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*. A new AMI gets published every few days, so each plan shows a diff on ami and a replacement of the instance. Nothing else in the module touches it. How do people normally stop this without hardcoding an AMI ID?
4 replies