brikis98 / terraform-up-and-running-code

Code samples for the book "Terraform: Up & Running" by Yevgeniy Brikman
http://www.terraformupandrunning.com/
MIT License
2.87k stars 1.92k forks source link

Error launching source instance: InvalidAMIID.NotFound: The image id '[ami-0c55b159cbfafe1f0]' #41

Closed yatakoi closed 4 years ago

yatakoi commented 4 years ago

Hello.

Using Deploy a Single Server as an example, I get an error.

`aws_instance.example: Creating...

Error: Error launching source instance: InvalidAMIID.NotFound: The image id '[ami-0c55b159cbfafe1f0]' does not exist status code: 400, request id: f5e8a0a2-0de9-4476-ad8b-c3473f93532c

on main.tf line 5, in resource "aws_instance" "example": 5: resource "aws_instance" "example" {`

brikis98 commented 4 years ago

Did you change the AWS region in the provider block? If so, each AMI ID lives in only one region, so you'll have to replace the AMI ID with a different ID for your new region.

shrutikamehta369 commented 4 years ago

That's right. I have changed the region. Its working now.

Thanks

ale-fante commented 4 years ago

Yup... the region!