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(s3): allow aliases for kms key #33993

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

andrewhertog
Copy link
Contributor

@andrewhertog andrewhertog commented Oct 5, 2023

Release 1.6.0 broke the ability to use s3 key aliases in the s3 backend. This change adjusts the tests, and validation of kms key arn's to look for aliases

Fixes #33979
Fixes #34005

Target Release

1.6.1

Draft CHANGELOG entry

BUG FIXES

  • Fixes the ability to use KMS key aliases in the S3 backend

@hashicorp-cla
Copy link

hashicorp-cla commented Oct 5, 2023

CLA assistant check
All committers have signed the CLA.

@andrewhertog andrewhertog force-pushed the fix/s3-backend-kms-alias branch from b5c16b3 to 6088002 Compare October 5, 2023 15:57
@andrewhertog andrewhertog marked this pull request as ready for review October 5, 2023 15:57
@andrewhertog andrewhertog requested a review from a team as a code owner October 5, 2023 15:57
@crw
Copy link
Contributor

crw commented Oct 5, 2023

Thanks for this submission! Labeling bug for now based on the originating issue, until I hear otherwise.

@jar-b jar-b added the 1.6-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Oct 9, 2023
@jar-b jar-b self-assigned this Oct 9, 2023
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

% TF_ACC=1 go test ./internal/backend/remote-state/s3/...
ok      github.com/hashicorp/terraform/internal/backend/remote-state/s3 139.877s

@jar-b
Copy link
Member

jar-b commented Oct 9, 2023

Thanks for the fix, @andrewhertog!

Just made a small adjustment to align the alias regular expression pattern with the AWS documentation:
https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateAlias.html#KMS-CreateAlias-request-AliasName

@jar-b jar-b merged commit 95d56b5 into hashicorp:main Oct 9, 2023
4 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@jar-b
Copy link
Member

jar-b commented Oct 9, 2023

This fix has been backported and will be available in Terraform 1.6.1.

@andrewhertog andrewhertog deleted the fix/s3-backend-kms-alias branch October 16, 2023 14:14
Copy link
Contributor

github-actions bot commented Dec 7, 2023

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 contributions.
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 Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.6-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged backend/s3 bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform 1.6.0 s3 backend kms_key_id doesn't work anymore with alias S3 backend with kms regression
4 participants