Skip to content

Error: Unexpected Identity Change #71

@c-warwick

Description

@c-warwick

Description

Getting this issue in GHA when upgrading to latest version. Additionally had to upgrade tf version from 1.1.9 to 1.12.2 + bumping hashicorp/aws provider from ~> 5 to ~> 6

 Error: Unexpected Identity Change: During the read operation, the Terraform Provider unexpectedly returned a different identity then the previously stored one.
│ 
│ 
│ The attribute "name" is deprecated. Refer to the provider documentation for
│ This is always a problem with the provider and should be reported to the provider developer.
│ details.
│ 
│ (and 5 more similar warnings elsewhere)
│ 
╵
│ Current Identity: cty.ObjectVal(map[string]cty.Value{"account_id":cty.NullVal(cty.String), "name":cty.NullVal(cty.String)})
│ 
│ New Identity: cty.ObjectVal(map[string]cty.Value{"account_id":cty.StringVal("<my-account-number>"), "name":cty.StringVal("<my-role>")})

If your request is for a new feature, please use the Feature request template.

  • ✋ I have searched the open/closed issues and my issue is not listed.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

  • Module version [Required]: 5.0

  • Terraform version: 1.12.2

  • Provider version(s): hashicorp/aws 6.1.0

Reproduction Code [Required]

Steps to reproduce the behavior:

no

yes

works locally, fails in CI

Expected behavior

standard apply

Actual behavior

Error: Unexpected Identity Change: During the read operation, the Terraform Provider unexpectedly returned a different identity then the previously stored one.
│ 
│ 
│ The attribute "name" is deprecated. Refer to the provider documentation for
│ This is always a problem with the provider and should be reported to the provider developer.
│ details.
│ 
│ (and 5 more similar warnings elsewhere)
│ 
╵
│ Current Identity: cty.ObjectVal(map[string]cty.Value{"account_id":cty.NullVal(cty.String), "name":cty.NullVal(cty.String)})
│ 
│ New Identity: cty.ObjectVal(map[string]cty.Value{"account_id":cty.StringVal("<my-account-number>"), "name":cty.StringVal("<my-role>")})
  1. Went to deploy as normal, it failed saying 1.1.9 was too old
  2. upgraded to 1.12.2, it failed saying hashicorp/aws 5 was too low
  3. upgraded hashicorp/aws 5 to 6
  4. clean apply locally
  5. fails in GHA with above error

Terminal Output Screenshot(s)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions