Skip to content

emr: terraform state containing very old terminated cluster causes plan to fail #7783

@ghost

Description

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


Terraform v0.11.7

  • Downloading plugin for provider "aws" (2.0.0)

I cannot easily test with 0.11.11 because I do not own the build server where this runs.

EMR cluster was manually terminated in dec 10th 2018. When I run terraform plan in feb 28th 2019 to create it, it failed.

I believe it failed because the EMR cluster history in aws goes back only two months, so the lookup for the cluster fails.

Workaround: I had no other resources in that terraform config, so I deleted the statefile. If I had other resources I would not be able to do that.

output (anonymised):

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

....

Error: Error refreshing state: 1 error(s) occurred:

  • aws_emr_cluster.XXXXXXXXX: 1 error(s) occurred:

  • aws_emr_cluster.XXXXXXXX: aws_emr_cluster.XXXXXXXX: Error reading EMR cluster: InvalidRequestException: Cluster id 'j-XXXXXXXXXX' is not valid.
    status code: 400, request id: XXXXXXX-XXXXXX-XXXX-XXXX-XXXXXXXXX

Metadata

Metadata

Assignees

Labels

bugAddresses a defect in current functionality.service/emrIssues and PRs that pertain to the emr service.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions