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

r/aws_mwaa_environment: Changing the KMS key used by MWAA should force recreation of the Airflow environment #19994

Merged
merged 2 commits into from
Jun 29, 2021

Conversation

jphuynh
Copy link
Contributor

@jphuynh jphuynh commented Jun 29, 2021

This is currently an issue when updating the cluster from aws/airflow KMS key to a CMK for example. The current implementation will show a diff, apply an update to the cluster but will not be able to change to another KMS key leading to a perpetual diff.

Terraform will perform the following actions:

  # module.airflow[0].aws_mwaa_environment.airflow will be updated in-place
  ~ resource "aws_mwaa_environment" "airflow" {
        id                              = "myairflow"
      + kms_key                         = "arn:aws:kms:us-east-1:redacted:key/redacted"
        name                            = "myairflow"
        tags                            = {
            "Name"                 = "myairflow"
        }
        # (21 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

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

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

… recreation of the Airflow environment

This is currently an issue when updating the cluster from `aws/airflow` KMS key to a CMK for example. The current implementation will show a diff, apply an update to the cluster but will not be able to change to another KMS key leading to a perpetual diff.

```
Terraform will perform the following actions:

  # module.airflow[0].aws_mwaa_environment.airflow will be updated in-place
  ~ resource "aws_mwaa_environment" "airflow" {
        id                              = "myairflow"
      + kms_key                         = "arn:aws:kms:us-east-1:redacted:key/redacted"
        name                            = "myairflow"
        tags                            = {
            "Name"                 = "myairflow"
        }
        # (21 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
```
@github-actions github-actions bot added service/mwaa Issues and PRs that pertain to the mwaa service. size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Jun 29, 2021
@ewbankkit ewbankkit changed the title r/aws_mwaa_environment: Changing the KMS key used by MWAA should… r/aws_mwaa_environment: Changing the KMS key used by MWAA should force recreation of the Airflow environment Jun 29, 2021
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jun 29, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

@ewbankkit
Copy link
Contributor

@jphuynh Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit ccc13f5 into hashicorp:main Jun 29, 2021
@github-actions github-actions bot added this to the v3.48.0 milestone Jun 29, 2021
@jphuynh jphuynh deleted the r_mwaa_kms_forcenew branch June 30, 2021 09:07
@github-actions
Copy link

github-actions bot commented Jul 8, 2021

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Aug 8, 2021

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 Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/mwaa Issues and PRs that pertain to the mwaa service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants