Skip to content

backend/s3: Relax endpoint validation rule #34017

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

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Oct 7, 2023

Relaxes endpoint URL validation for S3, DynamoDB, IAM, and STS to emit a warning rather than an error for incomplete URLs. The IMDS endpoint requires a complete URL, because url.Parse places bare hostnames in the Path field of url.URL and the IMDS client overwrites the Path.

According to the AWS documentation, the endpoint parameters should be full URLs.

Fixes #33981

Target Release

1.6.1

Draft CHANGELOG entry

BUG FIXES

  • Relaxes validation for S3, DynamoDB, IAM, and STS endpoint parameters

@gdavison gdavison requested a review from a team as a code owner October 7, 2023 00:02
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 145.979s

@jar-b jar-b added backend/s3 1.6-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged labels Oct 9, 2023
@jar-b jar-b force-pushed the s3/b-relax-endpoint-validation branch from d84a7e3 to 3de6dbc Compare October 9, 2023 19:03
@jar-b jar-b merged commit 4f26451 into main Oct 9, 2023
@jar-b jar-b deleted the s3/b-relax-endpoint-validation branch October 9, 2023 19:15
@jar-b jar-b restored the s3/b-relax-endpoint-validation branch October 9, 2023 19:15
@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 jar-b deleted the s3/b-relax-endpoint-validation branch October 9, 2023 19:16
@jar-b
Copy link
Member

jar-b commented Oct 9, 2023

This change has been backported and will be released with Terraform v1.6.1.

Copy link
Contributor

github-actions bot commented Dec 8, 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 8, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breaking change in 1.6.0: s3 backend config rejects hostname for endpoint parameter
2 participants