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

fix: More compatibility fixes for Terraform v0.13 and aws v3 #976

Merged
merged 4 commits into from
Sep 8, 2020

Conversation

dpiddockcmp
Copy link
Contributor

PR o'clock

Description

Terraform v0.13 and aws v3 support time!

When upgrading an existing TF 0.12/aws 2 cluster to TF 0.13/aws 3 you currently have to manually edit the state file to delete removed attributes. Should be fixed in v0.13.1 hashicorp/terraform#25779 . For the basic example I had to remove the following attributes:

You also need to mess around with replace-provider a lot:

terraform state replace-provider -- -/aws hashicorp/aws
terraform state replace-provider -- -/kubernetes hashicorp/kubernetes
terraform state replace-provider -- -/local hashicorp/local
terraform state replace-provider -- -/null hashicorp/null
terraform state replace-provider -- -/random hashicorp/random
terraform state replace-provider -- -/template hashicorp/template

Checklist

```
Error: Provider produced inconsistent final plan

When expanding the plan for module.eks.aws_autoscaling_group.workers[0] to
include new values learned so far during apply, provider
"registry.terraform.io/hashicorp/aws" produced an invalid new value for .tags:
length changed from 4 to 6.
```

hashicorp/terraform-provider-aws#14085
workers.tf Show resolved Hide resolved
@daroga0002
Copy link
Contributor

@dpiddockcmp looks Terraform 13.1 was released so should solve mentioned bug

https://github.com/hashicorp/terraform/releases/tag/v0.13.1

@dpiddockcmp
Copy link
Contributor Author

@barryib are we good to merge this?

@barryib
Copy link
Member

barryib commented Sep 2, 2020

Please let me test this tonight with TF 0.13.1

@barryib
Copy link
Member

barryib commented Sep 2, 2020

@dpiddockcmp LGTM. Just tested an upgrade TF 0.12 to TF 0.13.1 without error. Shouldn't we change the Terraform required version to avoid TF 0.13.0 ("~> 0.12.9, >= 0.13.1") ?

@barryib barryib added this to the v13.0.0 milestone Sep 2, 2020
@dpiddockcmp
Copy link
Contributor Author

That version constraint can't be met. It can't be 0.12.* and greater than 0.13.0. Could use >= 0.12.9, != 0.13.0

@barryib
Copy link
Member

barryib commented Sep 4, 2020

That version constraint can't be met. It can't be 0.12.* and greater than 0.13.0. Could use >= 0.12.9, != 0.13.0

Ok. LGTM.

@dpiddockcmp dpiddockcmp merged commit bceb966 into terraform-aws-modules:master Sep 8, 2020
@dpiddockcmp dpiddockcmp deleted the tf13 branch September 8, 2020 16:25
barryib pushed a commit to Polyconseil/terraform-aws-eks that referenced this pull request Oct 25, 2020
…rm-aws-modules#976)

Additional support for Terraform v0.13 and aws v3!
- The update to the vpc module in examples was, strictly speaking, unnecessary but it adds the terraform block with supported versions.
- Update for iam module in the example was very necessary to support new versions
- Workaround for "Provider produced inconsistent final plan" when creating ASGs at the same time as the cluster. See  hashicorp/terraform-provider-aws#14085 for full details.
- Blacklist 0.13.0 as it was too strict when migrating from aws v2 to v3 about dropped attributes.
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants