wardviaene / terraform-course

Course files for my Udemy course about Terraform
https://www.udemy.com/learn-devops-infrastructure-automation-with-terraform/?couponCode=TERRAFORM_GIT
1.58k stars 4.01k forks source link

Unable to launch EC2 instance #29

Closed KritiS closed 4 years ago

KritiS commented 4 years ago

Trying to create the ec2 instance following the steps in Udemy course.

install.tf

provider "aws" {
  access_key = ""
  secret_key = ""
  region     = "us-east-2"
}

resource "aws_instance" "example" {
  ami           = "ami-0bb2a062146998209"
  instance_type = "t2.micro"
}

Getting below error -

Error: Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
    status code: 400, request id: 9115509c-2381-465c-b279-f2c409b65dc1

  on instance.tf line 7, in resource "aws_instance" "example":
   7: resource "aws_instance" "example" {

Using https://cloud-images.ubuntu.com/locator/ec2/ to get the AMI ID

wardviaene commented 4 years ago

ami-0bb2a062146998209 is ARM based, which is a different architecture. You need amd64, for example: ami-08cec7c429219e339