backend/s3: prevent keys containing double slashes #33869
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the AWS Go SDK V2, URI cleaning of S3 object URLs is no longer done by default. As such,
key
values containing double slashes (//
) could introduce situations where an existing statefile cannot be read. This additional validation step disallows keys containing double slashes to prevent this.Prevention of leading and trailing slashes (also potential failure points with AWS Go SDK v2) is already done via the
validateStringS3Path
validator.Relates #33687
Relates hashicorp/terraform-provider-aws#33358 (changes to URI cleaning discovered during SDK upgrade of this resource in the AWS Provider)
Target Release
1.6.x
Draft CHANGELOG entry
N/A - validation change only.