简体   繁体   中英

Terraform AWS, instance not created

I'm going through the Terraform tutorial for AWS. When I apply the Terraform file (exactly as it is in the tutorial), I get:

# aws_instance.example will be created
+ resource "aws_instance" "example" {
    ...
  }
  ...
  apply complete! Resources: 1 added, 0 changed, 0 destroyed.

But when I go to the dashboard of EC2, I don't see the instance. I only have 1 security group.

What am I doing wrong?

PS Here is my region that I set in aws configure : use2-az1

you can run terraform show command in the directory where you ran terraform apply it will show you the all the resource created.

Plus don't use AZ ID AZ IDs for your AWS resources even in your configuration for credentials, unless you have a very specific reason to do so.

As per the tutorial you have configured your aws provider:

provider "aws" {
  profile = "default"
  region  = "us-west-2"
}

Because you mentioned you followed exactly as it is in tutorial, you should be able to see the instance in the respective region which is us-west-2 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM