-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Add validation for aws_s3_bucket_metric.name
#25260
Conversation
8fc422f
to
b88219c
Compare
…tion to be minimum 1 char
b88219c
to
2b1449f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cherry-picked @meetreks changes (thanks @meetreks for your contribution as well 🎉 ), with a small update to set the validation minimum to 1
as you had done originally for bucket
since validation looked to be added to bucket
instead of name
by mistake.
Output of acceptance tests:
$ make testacc TESTARGS='-run=TestAccS3BucketMetric_' PKG=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run=TestAccS3BucketMetric_ -timeout 180m
=== RUN TestAccS3BucketMetric_basic
=== PAUSE TestAccS3BucketMetric_basic
=== RUN TestAccS3BucketMetric_withEmptyFilter
=== PAUSE TestAccS3BucketMetric_withEmptyFilter
=== RUN TestAccS3BucketMetric_withFilterPrefix
=== PAUSE TestAccS3BucketMetric_withFilterPrefix
=== RUN TestAccS3BucketMetric_withFilterPrefixAndMultipleTags
=== PAUSE TestAccS3BucketMetric_withFilterPrefixAndMultipleTags
=== RUN TestAccS3BucketMetric_withFilterPrefixAndSingleTag
=== PAUSE TestAccS3BucketMetric_withFilterPrefixAndSingleTag
=== RUN TestAccS3BucketMetric_withFilterMultipleTags
=== PAUSE TestAccS3BucketMetric_withFilterMultipleTags
=== RUN TestAccS3BucketMetric_withFilterSingleTag
=== PAUSE TestAccS3BucketMetric_withFilterSingleTag
=== CONT TestAccS3BucketMetric_basic
=== CONT TestAccS3BucketMetric_withFilterPrefixAndSingleTag
=== CONT TestAccS3BucketMetric_withFilterSingleTag
=== CONT TestAccS3BucketMetric_withFilterMultipleTags
=== CONT TestAccS3BucketMetric_withFilterPrefixAndMultipleTags
=== CONT TestAccS3BucketMetric_withFilterPrefix
=== CONT TestAccS3BucketMetric_withEmptyFilter
--- PASS: TestAccS3BucketMetric_withEmptyFilter (2.04s)
--- PASS: TestAccS3BucketMetric_basic (23.90s)
--- PASS: TestAccS3BucketMetric_withFilterSingleTag (41.11s)
--- PASS: TestAccS3BucketMetric_withFilterPrefix (41.69s)
--- PASS: TestAccS3BucketMetric_withFilterPrefixAndMultipleTags (41.85s)
--- PASS: TestAccS3BucketMetric_withFilterMultipleTags (41.88s)
--- PASS: TestAccS3BucketMetric_withFilterPrefixAndSingleTag (41.88s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/s3 44.947s
This functionality has been released in v4.20.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! |
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. |
Community Note
Closes #25251
Output from acceptance testing:
Information
As called out in the linked issue,
aws_s3_bucket_metric.name
must be less than or equal to 64 characters. I've not been able to find any AWS documents that call out this requirement, but tested manually (reproduction notes below) to verify this requirement.Notes
I have not added any additional testing around this change. This is my first code change for the provider, and in looking around, I wasn't able to find any other areas where there are tests specific to
ValidateFunc
s. If additional test(s) are needed, I'm happy to write them if someone could point me in the right direction for a reference 🙂Reproductions proving this behavior
Works:
Configuration:
Output:
Doesn't work (>64 characters)
Configuration:
Output:
Doesn't work (0 characters)
Configuration:
Output: