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

Removal of deprecated attributes and existing state file #14458

Closed
kimor79 opened this issue Aug 3, 2020 · 2 comments
Closed

Removal of deprecated attributes and existing state file #14458

kimor79 opened this issue Aug 3, 2020 · 2 comments
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. service/iam Issues and PRs that pertain to the iam service. service/route53 Issues and PRs that pertain to the route53 service. upstream-terraform Addresses functionality related to the Terraform core binary.

Comments

@kimor79
Copy link

kimor79 commented Aug 3, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.13.0-rc1
+ provider registry.terraform.io/hashicorp/aws v3.0.0
+ provider registry.terraform.io/hashicorp/time v0.5.0

Affected Resource(s)

so far:

  • aws_region (datasource)
  • aws_route53_zone
  • aws_iam_role (datasource)
  • aws_availability_zones (datasource)

Terraform Configuration Files

data "aws_region" "current" {}

resource "aws_route53_zone" "main" {
  lifecycle {
    ignore_changes = [vpc]
  }

  comment = local.vpc_name
  name    = local.domain_name
  tags    = local.tags
  vpc {
    vpc_id = aws_vpc.main.id
  }
}

Debug Output

Panic Output

Expected Behavior

normal plan output

Actual Behavior

Error: Invalid resource instance data in state

  on path/to/file/with/region_datasource line 1:
   1: data "aws_region" "current" {}

Instance
module.my-module.data.aws_region.current
data could not be decoded from the state: unsupported attribute "current".

Error: Invalid resource instance data in state

  on ../path/to/file/with/route53_zone_resource line 4:
   4: resource "aws_route53_zone" "main" {

Instance
module.my-module.aws_route53_zone.main data
could not be decoded from the state: unsupported attribute "vpc_id".

Steps to Reproduce

  1. Have an existing state file (I don't know what version of the provider it was created with but I think it is 2.70.0)
  2. rm -fr .terraform
  3. terraform init
  4. terraform plan

Important Factoids

My state file has entries like below and it seems as though the existence of removed attributes from the provider causes terraform to get into a stuck state. If I state rm the data.aws_region instances, terraform continues on but there are too many existing resources for me to rm them all or start with an empty state and import.

    {
      "module": "module.my-module",
      "mode": "data",
      "type": "aws_region",
      "name": "current",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"].my-module",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "current": null,
            "description": "US East (N. Virginia)",
            "endpoint": "ec2.us-east-1.amazonaws.com",
            "id": "us-east-1",
            "name": "us-east-1"
          }
        }
      ]
    },

References

@ghost ghost added service/ec2 Issues and PRs that pertain to the ec2 service. service/iam Issues and PRs that pertain to the iam service. service/route53 Issues and PRs that pertain to the route53 service. labels Aug 3, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 3, 2020
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. upstream-terraform Addresses functionality related to the Terraform core binary. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 3, 2020
@ewbankkit
Copy link
Contributor

@kimor79 Thanks for raising this issue.
It has already been noticed in #14431. I'm going to close this one as a duplicate so that we can concentrate discussion in the linked issue.
Please add any additional comments there.

@ghost
Copy link

ghost commented Sep 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 Sep 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. service/iam Issues and PRs that pertain to the iam service. service/route53 Issues and PRs that pertain to the route53 service. upstream-terraform Addresses functionality related to the Terraform core binary.
Projects
None yet
Development

No branches or pull requests

2 participants