Pocket Theories

Common Terraform Problems

Invalid AWS Region

Invalid AWS region

me-central-1 is a perfectly valid region… but the AWS terraform provider version predates the launch of the AWS region, so we update the Terraform provider version, and it’s all-good.

The image id ‘[ami-xxxxxxxxxxx]’ does not exist

The image id ami does not exist

AWS has a support lifecycle for EC2 Operating System images, just as we do for database versions. When an OS version gets old, they sunset it. The Community AMIs often contain the old Operating System images (sometimes with their own fee added to the EC2 costs), or we can find a newer one.

api error Unsupported: The requested configuration is currently not supported

The requested configuration is currently not supported

Either there’s a mis-match between the AMI and the instance type, or the instance type specified (Eg. "t2.micro" is unavailable but "t3.micro" is) is not available in the specified region... ...or, it’s something entirely different :froge-dunno: . You’ll have to use the web GUI with the same parameters to determine the cause.

Resources of type "null_resource" are always executed

User triggers. "The triggers argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced." (Click for source)