Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform 0.11.8 - attribute mismatch: credit_specification cpu_credits #5853

Closed
ghost opened this issue Sep 12, 2018 · 5 comments · Fixed by #5805
Closed

terraform 0.11.8 - attribute mismatch: credit_specification cpu_credits #5853

ghost opened this issue Sep 12, 2018 · 5 comments · Fixed by #5805
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@ghost
Copy link

ghost commented Sep 12, 2018

This issue was originally opened by @snimark as hashicorp/terraform#18844. It was migrated here as a result of the provider split. The original body of the issue is below.


I am getting this error message when trying to apply a change to my EC2 instance when trying to invoke a change which requires replacing my EC2.

Terraform Version

Linux 64-bit

Terraform v0.11.8
+ provider.aws v1.35.0

Terraform File

provider "aws" {
  access_key = "<ACCESS_KEY>"
  secret_key = "<SECRET_KEY>"
  region     = "us-east-1"
}

resource "aws_instance" "example" {
  ami             = "ami-05f5f435263ef131e"
  instance_type   = "t3.micro"
  key_name        = "key1"
  subnet_id       = "subnet-056cfe06"
  security_groups = ["sg-da73baa9", "sg-6a8d451a"]
  tags            = [{"Name" = "terraform-example"},
                     {"Owner" = "mark_@email.com"},
                     {"BusinessUnit" = "automation"},
                     {"Environment" = "admin"}]
  provisioner "local-exec" {
    command = "echo ${aws_instance.example.public_ip} > ip_address.txt"
  }
}

resource "aws_eip" "ip" {
  instance = "${aws_instance.example.id}"
}

Crash Output

    Terraform Version: 0.11.8
    Resource ID: aws_instance.example
    Mismatch reason: attribute mismatch: credit_specification.0.cpu_credits
    Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"placement_group":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.Owner":*terraform.ResourceAttrDiff{Old:"mark_@email.com", New:"mark_@email.com", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "security_groups.#":*terraform.ResourceAttrDiff{Old:"0", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tags.Environment":*terraform.ResourceAttrDiff{Old:"admin", New:"admin", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "private_dns":*terraform.ResourceAttrDiff{Old:"ip-10-50-246-148.ec2.internal", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tenancy":*terraform.ResourceAttrDiff{Old:"default", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "security_groups.7189852":*terraform.ResourceAttrDiff{Old:"", New:"sg-db73baa9", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "security_groups.498484961":*terraform.ResourceAttrDiff{Old:"", New:"sg=688d451a", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tags.BusinessUnit":*terraform.ResourceAttrDiff{Old:"automation", New:"automation", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "get_password_data":*terraform.ResourceAttrDiff{Old:"false", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instance_type":*terraform.ResourceAttrDiff{Old:"t3.micro", New:"t3.micro", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "public_ip":*terraform.ResourceAttrDiff{Old:"18.209.120.106", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "source_dest_check":*terraform.ResourceAttrDiff{Old:"true", New:"true", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ephemeral_block_device.#":*terraform.ResourceAttrDiff{Old:"0", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ipv6_address_count":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "public_dns":*terraform.ResourceAttrDiff{Old:"ec2-18-209-120-106.compute-1.amazonaws.com", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "key_name":*terraform.ResourceAttrDiff{Old:"kpa17173", New:"kpa17173", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "password_data":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "cpu_threads_per_core":*terraform.ResourceAttrDiff{Old:"2", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ami":*terraform.ResourceAttrDiff{Old:"ami-05f5f435263ef131e", New:"ami-05f5f435263ef131e", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ipv6_addresses.#":*terraform.ResourceAttrDiff{Old:"0", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instance_state":*terraform.ResourceAttrDiff{Old:"running", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ebs_block_device.#":*terraform.ResourceAttrDiff{Old:"0", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "volume_tags.%":*terraform.ResourceAttrDiff{Old:"0", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "network_interface.#":*terraform.ResourceAttrDiff{Old:"0", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "root_block_device.#":*terraform.ResourceAttrDiff{Old:"1", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "associate_public_ip_address":*terraform.ResourceAttrDiff{Old:"true", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "primary_network_interface_id":*terraform.ResourceAttrDiff{Old:"eni-043cab4125cfe2d9d", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "vpc_security_group_ids.#":*terraform.ResourceAttrDiff{Old:"1", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "arn":*terraform.ResourceAttrDiff{Old:"arn:aws:ec2:us-east-1:0123456789012:instance/i-031dd98774e166e5b", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.Name":*terraform.ResourceAttrDiff{Old:"admin-automation-terraform-example", New:"admin-automation-terraform-example", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "private_ip":*terraform.ResourceAttrDiff{Old:"10.50.246.148", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "cpu_core_count":*terraform.ResourceAttrDiff{Old:"1", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "network_interface_id":*terraform.ResourceAttrDiff{Old:"eni-043cab4125cfe2d9d", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "credit_specification.0.cpu_credits":*terraform.ResourceAttrDiff{Old:"unlimited", New:"standard", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "subnet_id":*terraform.ResourceAttrDiff{Old:"subnet-0aacfe06", New:"subnet-0aacfe06", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.%":*terraform.ResourceAttrDiff{Old:"4", New:"4", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "availability_zone":*terraform.ResourceAttrDiff{Old:"us-east-1f", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
    Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"security_groups.#":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "availability_zone":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "network_interface_id":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "network_interface.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "cpu_core_count":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "ephemeral_block_device.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tags.%":*terraform.ResourceAttrDiff{Old:"", New:"4", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "associate_public_ip_address":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "get_password_data":*terraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.Name":*terraform.ResourceAttrDiff{Old:"", New:"admin-automation-terraform-example", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "subnet_id":*terraform.ResourceAttrDiff{Old:"", New:"subnet-0aacfe06", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "private_ip":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "public_ip":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instance_state":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "placement_group":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "public_dns":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "root_block_device.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "private_dns":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ebs_block_device.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instance_type":*terraform.ResourceAttrDiff{Old:"", New:"t3.micro", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.Owner":*terraform.ResourceAttrDiff{Old:"", New:"mark_@email.com", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ipv6_addresses.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "security_groups.7189852":*terraform.ResourceAttrDiff{Old:"", New:"sg-db73baa9", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "ami":*terraform.ResourceAttrDiff{Old:"", New:"ami-05f5f435263ef131e", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "cpu_threads_per_core":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tags.BusinessUnit":*terraform.ResourceAttrDiff{Old:"", New:"automation", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "security_groups.498484961":*terraform.ResourceAttrDiff{Old:"", New:"sg=688d451a", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tenancy":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tags.Environment":*terraform.ResourceAttrDiff{Old:"", New:"admin", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "source_dest_check":*terraform.ResourceAttrDiff{Old:"", New:"true", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "key_name":*terraform.ResourceAttrDiff{Old:"", New:"kpa17173", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "password_data":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "primary_network_interface_id":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "vpc_security_group_ids.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ipv6_address_count":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "volume_tags.%":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}

File: crash.output.txt

Expected Behavior

According the to the tutorial, running terraform apply to change an AWS EC2 should remove the old instance and create a new one to take its place.

Actual Behavior

It seems to actually destroy the old instance, but it faults before creating the replacement instance. This behavior is repeatable.

Steps to Reproduce

  1. create a terraform file to create an EC2.
  2. run: terraform apply
  3. change the terraform file with a modification which requires replacing the EC2.
  4. run: terraform apply again
@bflad bflad added bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. labels Sep 13, 2018
@robinaa
Copy link

robinaa commented Sep 13, 2018

I am having exactly the same issue.

Terraform Version

Mac OS High Sierra 64bit

Terraform v0.11.8
+ provider.aws v1.35.0

Reproducible error as mentioned in the original issue.
Any modification on the tf file which may require replacement of the EC2 instance errors out after destroying the EC2 instance.

@jojje
Copy link

jojje commented Sep 14, 2018

Same issue here

  • OS: Windows 7 Pro 64-bit
  • Terraform version: v0.11.8 (64-bit)

Problem encountered when following the getting started document.
On a fresh account, applied the following plan:

provider "aws" {
  region     = "eu-central-1"
  version    = "~> 1.36"
}
resource "aws_instance" "example" {
  ami           = "ami-0f5dbc86dd9cbf7a8"
  instance_type = "t3.nano"
}

This worked as described. However when changing the AMI and re-applying the template, the reported error occurred.

I.e. applying this plan:

provider "aws" {
  region     = "eu-central-1"
  version    = "~> 1.36"
}
resource "aws_instance" "example" {
  ami           = "ami-027583e616ca104df"
  instance_type = "t3.nano"
}

Produced the following output and error:

>terraform apply
aws_instance.example: Refreshing state... (ID: i-0eaa15e63a7cdc24d)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

-/+ aws_instance.example (new resource required)
      id:                                 "i-0eaa15e63a7cdc24d" => <computed> (forces new resource)
      ami:                                "ami-0f5dbc86dd9cbf7a8" => "ami-027583e616ca104df" (forces new resource)
      arn:                                "arn:aws:ec2:eu-central-1:............:instance/i-0eaa15e63a7cdc24d" => <computed>
      associate_public_ip_address:        "true" => <computed>
      availability_zone:                  "eu-central-1c" => <computed>
      cpu_core_count:                     "1" => <computed>
      cpu_threads_per_core:               "2" => <computed>
      credit_specification.0.cpu_credits: "unlimited" => "standard"
      ebs_block_device.#:                 "0" => <computed>
      ephemeral_block_device.#:           "0" => <computed>
      get_password_data:                  "false" => "false"
      instance_state:                     "running" => <computed>
      instance_type:                      "t3.nano" => "t3.nano"
      ipv6_address_count:                 "" => <computed>
      ipv6_addresses.#:                   "0" => <computed>
      key_name:                           "" => <computed>
      network_interface.#:                "0" => <computed>
      network_interface_id:               "eni-04cc359f831c9b1d0" => <computed>
      password_data:                      "" => <computed>
      placement_group:                    "" => <computed>
      primary_network_interface_id:       "eni-04cc359f831c9b1d0" => <computed>
      private_dns:                        "ip-172-31-32-76.eu-central-1.compute.internal" => <computed>
      private_ip:                         "172.31.32.76" => <computed>
      public_dns:                         "ec2-35-158-255-178.eu-central-1.compute.amazonaws.com" => <computed>
      public_ip:                          "35.158.255.178" => <computed>
      root_block_device.#:                "1" => <computed>
      security_groups.#:                  "1" => <computed>
      source_dest_check:                  "true" => "true"
      subnet_id:                          "subnet-fe7d5fb4" => <computed>
      tenancy:                            "default" => <computed>
      volume_tags.%:                      "0" => <computed>
      vpc_security_group_ids.#:           "1" => <computed>


Plan: 1 to add, 0 to change, 1 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

aws_instance.example: Destroying... (ID: i-0eaa15e63a7cdc24d)
aws_instance.example: Still destroying... (ID: i-0eaa15e63a7cdc24d, 10s elapsed)
aws_instance.example: Still destroying... (ID: i-0eaa15e63a7cdc24d, 20s elapsed)
aws_instance.example: Destruction complete after 30s

Error: Error applying plan:

1 error(s) occurred:

* aws_instance.example: aws_instance.example: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.

Please include the following information in your report:

    Terraform Version: 0.11.8
    Resource ID: aws_instance.example
    Mismatch reason: attribute mismatch: credit_specification.0.cpu_credits
    Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terra
form.ResourceAttrDiff{"key_name":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtr
a:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "cpu_threads_per_core":*terraform.ResourceAttrDiff{O
ld:"2", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type
:0x0}, "private_dns":*terraform.ResourceAttrDiff{Old:"ip-172-31-32-76.eu-central-1.compute.internal", New:"", NewCompute
d:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tenancy":*terrafor
m.ResourceAttrDiff{Old:"default", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:fa
lse, Sensitive:false, Type:0x0}, "credit_specification.0.cpu_credits":*terraform.ResourceAttrDiff{Old:"unlimited", New:"
standard", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0
}, "root_block_device.#":*terraform.ResourceAttrDiff{Old:"1", New:"", NewComputed:true, NewRemoved:false, NewExtra:inter
face {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "password_data":*terraform.ResourceAttrDiff{Old:"", New:"",
 NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "public_
ip":*terraform.ResourceAttrDiff{Old:"35.158.255.178", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(
nil), RequiresNew:false, Sensitive:false, Type:0x0}, "availability_zone":*terraform.ResourceAttrDiff{Old:"eu-central-1c"
, New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0},
 "ephemeral_block_device.#":*terraform.ResourceAttrDiff{Old:"0", New:"", NewComputed:true, NewRemoved:false, NewExtra:in
terface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "volume_tags.%":*terraform.ResourceAttrDiff{Old:"0", New
:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "arn
":*terraform.ResourceAttrDiff{Old:"arn:aws:ec2:eu-central-1:............:instance/i-0eaa15e63a7cdc24d", New:"", NewCompu
ted:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instance_type":*
terraform.ResourceAttrDiff{Old:"t3.nano", New:"t3.nano", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil)
, RequiresNew:false, Sensitive:false, Type:0x0}, "subnet_id":*terraform.ResourceAttrDiff{Old:"subnet-fe7d5fb4", New:"",
NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instance
_state":*terraform.ResourceAttrDiff{Old:"running", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil
), RequiresNew:false, Sensitive:false, Type:0x0}, "network_interface_id":*terraform.ResourceAttrDiff{Old:"eni-04cc359f83
1c9b1d0", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Ty
pe:0x0}, "ebs_block_device.#":*terraform.ResourceAttrDiff{Old:"0", New:"", NewComputed:true, NewRemoved:false, NewExtra:
interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "placement_group":*terraform.ResourceAttrDiff{Old:"",
New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "
get_password_data":*terraform.ResourceAttrDiff{Old:"false", New:"false", NewComputed:false, NewRemoved:false, NewExtra:i
nterface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "source_dest_check":*terraform.ResourceAttrDiff{Old:"tr
ue", New:"true", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Ty
pe:0x0}, "ipv6_addresses.#":*terraform.ResourceAttrDiff{Old:"0", New:"", NewComputed:true, NewRemoved:false, NewExtra:in
terface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ipv6_address_count":*terraform.ResourceAttrDiff{Old:"",
 New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0},
"network_interface.#":*terraform.ResourceAttrDiff{Old:"0", New:"", NewComputed:true, NewRemoved:false, NewExtra:interfac
e {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ami":*terraform.ResourceAttrDiff{Old:"ami-0f5dbc86dd9cbf7a8",
 New:"ami-027583e616ca104df", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensiti
ve:false, Type:0x0}, "private_ip":*terraform.ResourceAttrDiff{Old:"172.31.32.76", New:"", NewComputed:true, NewRemoved:f
alse, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "public_dns":*terraform.ResourceAttrDif
f{Old:"ec2-35-158-255-178.eu-central-1.compute.amazonaws.com", New:"", NewComputed:true, NewRemoved:false, NewExtra:inte
rface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "security_groups.#":*terraform.ResourceAttrDiff{Old:"1", N
ew:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "v
pc_security_group_ids.#":*terraform.ResourceAttrDiff{Old:"1", New:"", NewComputed:true, NewRemoved:false, NewExtra:inter
face {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "associate_public_ip_address":*terraform.ResourceAttrDiff{O
ld:"true", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, T
ype:0x0}, "primary_network_interface_id":*terraform.ResourceAttrDiff{Old:"eni-04cc359f831c9b1d0", New:"", NewComputed:tr
ue, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "cpu_core_count":*terra
form.ResourceAttrDiff{Old:"1", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false
, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(n
il)}
    Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terr
aform.ResourceAttrDiff{"vpc_security_group_ids.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemov
ed:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "network_interface_id":*terraform.R
esourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensi
tive:false, Type:0x0}, "placement_group":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false,
 NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "availability_zone":*terraform.ResourceAttrDi
ff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Ty
pe:0x0}, "public_ip":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface
{}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "security_groups.#":*terraform.ResourceAttrDiff{Old:"", New:"",
NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "ebs_block
_device.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), R
equiresNew:false, Sensitive:false, Type:0x0}, "cpu_core_count":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:t
rue, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "get_password_data":*te
rraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresN
ew:false, Sensitive:false, Type:0x0}, "root_block_device.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true
, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instance_state":*terrafo
rm.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, S
ensitive:false, Type:0x0}, "ipv6_address_count":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved
:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "ami":*terraform.ResourceAttrDiff{Old:
"", New:"ami-027583e616ca104df", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sens
itive:false, Type:0x0}, "subnet_id":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewE
xtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "private_dns":*terraform.ResourceAttrDiff{Old:"",
New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "
ephemeral_block_device.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:inter
face {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "public_dns":*terraform.ResourceAttrDiff{Old:"", New:"", New
Computed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "source_dest
_check":*terraform.ResourceAttrDiff{Old:"", New:"true", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil),
 RequiresNew:false, Sensitive:false, Type:0x0}, "ipv6_addresses.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComput
ed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "cpu_threads_per_co
re":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), Requires
New:true, Sensitive:false, Type:0x0}, "tenancy":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved
:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "private_ip":*terraform.ResourceAttrDi
ff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Ty
pe:0x0}, "associate_public_ip_address":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, N
ewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "primary_network_interface_id":*terraform.Resou
rceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive
:false, Type:0x0}, "key_name":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:i
nterface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewCom
puted:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "volume_tags.%"
:*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew
:false, Sensitive:false, Type:0x0}, "network_interface.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true,
NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instance_type":*terraform.
ResourceAttrDiff{Old:"", New:"t3.nano", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:fal
se, Sensitive:false, Type:0x0}, "password_data":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved
:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false,
 DestroyTainted:false, Meta:map[string]interface {}(nil)}

Also include as much context as you can about your config, state, and the steps you performed to trigger this error.


Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

@bflad
Copy link
Contributor

bflad commented Sep 18, 2018

The fix for this has been merged into master for the aws_instance resource and will release with version 1.37.0 of the AWS provider, likely tomorrow.

@bflad
Copy link
Contributor

bflad commented Sep 19, 2018

This has been released in version 1.37.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link
Author

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants