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_cloudwatch_log_group: Add validation for retention_in_days #14673

Merged
merged 3 commits into from
Feb 11, 2021

Conversation

shuheiktgw
Copy link
Collaborator

@shuheiktgw shuheiktgw commented Aug 16, 2020

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

Release note for CHANGELOG:

r/aws_cloudwatch_log_group: Add validation for retention_in_days

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSCloudWatchLogGroup'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudWatchLogGroup -timeout 120m
=== RUN   TestAccAWSCloudWatchLogGroup_basic
=== PAUSE TestAccAWSCloudWatchLogGroup_basic
=== RUN   TestAccAWSCloudWatchLogGroup_namePrefix
=== PAUSE TestAccAWSCloudWatchLogGroup_namePrefix
=== RUN   TestAccAWSCloudWatchLogGroup_namePrefix_retention
=== PAUSE TestAccAWSCloudWatchLogGroup_namePrefix_retention
=== RUN   TestAccAWSCloudWatchLogGroup_generatedName
=== PAUSE TestAccAWSCloudWatchLogGroup_generatedName
=== RUN   TestAccAWSCloudWatchLogGroup_retentionPolicy
=== PAUSE TestAccAWSCloudWatchLogGroup_retentionPolicy
=== RUN   TestAccAWSCloudWatchLogGroup_multiple
=== PAUSE TestAccAWSCloudWatchLogGroup_multiple
=== RUN   TestAccAWSCloudWatchLogGroup_disappears
=== PAUSE TestAccAWSCloudWatchLogGroup_disappears
=== RUN   TestAccAWSCloudWatchLogGroup_tagging
=== PAUSE TestAccAWSCloudWatchLogGroup_tagging
=== RUN   TestAccAWSCloudWatchLogGroup_kmsKey
=== PAUSE TestAccAWSCloudWatchLogGroup_kmsKey
=== CONT  TestAccAWSCloudWatchLogGroup_basic
=== CONT  TestAccAWSCloudWatchLogGroup_multiple
=== CONT  TestAccAWSCloudWatchLogGroup_tagging
=== CONT  TestAccAWSCloudWatchLogGroup_generatedName
=== CONT  TestAccAWSCloudWatchLogGroup_kmsKey
=== CONT  TestAccAWSCloudWatchLogGroup_namePrefix_retention
=== CONT  TestAccAWSCloudWatchLogGroup_retentionPolicy
=== CONT  TestAccAWSCloudWatchLogGroup_disappears
=== CONT  TestAccAWSCloudWatchLogGroup_namePrefix
    TestAccAWSCloudWatchLogGroup_disappears: resource_aws_cloudwatch_log_group_test.go:284: [INFO] Got non-empty plan, as expected
--- PASS: TestAccAWSCloudWatchLogGroup_disappears (42.38s)
--- PASS: TestAccAWSCloudWatchLogGroup_basic (54.09s)
--- PASS: TestAccAWSCloudWatchLogGroup_generatedName (55.71s)
--- PASS: TestAccAWSCloudWatchLogGroup_namePrefix (56.98s)
--- PASS: TestAccAWSCloudWatchLogGroup_multiple (57.81s)
--- PASS: TestAccAWSCloudWatchLogGroup_kmsKey (80.57s)
--- PASS: TestAccAWSCloudWatchLogGroup_retentionPolicy (81.99s)
--- PASS: TestAccAWSCloudWatchLogGroup_namePrefix_retention (82.39s)
--- PASS: TestAccAWSCloudWatchLogGroup_tagging (125.99s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	127.777s
...

I noticed CloudWatch Log Group's retentionInDays has a list of possible values (ref) but its validation is missing. As a result, a user cannot tell if the value is valid or not until she applies the change. It would be nice if we have validation for it.

Thank you for your review! 👍

@shuheiktgw shuheiktgw requested a review from a team August 16, 2020 21:16
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/cloudwatchlogs labels Aug 16, 2020
@shuheiktgw shuheiktgw changed the title r/aws_cloudwatch_log_group: Add validation to retention_in_days r/aws_cloudwatch_log_group: Add validation for retention_in_days Aug 16, 2020
Base automatically changed from master to main January 23, 2021 00:58
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:58
@bflad bflad self-assigned this Feb 11, 2021
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 11, 2021
bflad added a commit that referenced this pull request Feb 11, 2021
@bflad bflad merged commit 5191dcf into hashicorp:main Feb 11, 2021
@github-actions github-actions bot added this to the v3.28.0 milestone Feb 11, 2021
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Output from acceptance testing in AWS Commercial:

--- PASS: TestAccAWSCloudWatchLogGroup_disappears (12.92s)
--- PASS: TestAccAWSCloudWatchLogGroup_basic (18.01s)
--- PASS: TestAccAWSCloudWatchLogGroup_namePrefix (18.54s)
--- PASS: TestAccAWSCloudWatchLogGroup_generatedName (18.63s)
--- PASS: TestAccAWSCloudWatchLogGroup_multiple (19.47s)
--- PASS: TestAccAWSCloudWatchLogGroup_retentionPolicy (28.45s)
--- PASS: TestAccAWSCloudWatchLogGroup_namePrefix_retention (29.61s)
--- PASS: TestAccAWSCloudWatchLogGroup_kmsKey (33.05s)
--- PASS: TestAccAWSCloudWatchLogGroup_tagging (47.03s)

Output from acceptance testing in AWS GovCloud (US):

--- PASS: TestAccAWSCloudWatchLogGroup_disappears (16.57s)
--- PASS: TestAccAWSCloudWatchLogGroup_namePrefix (21.12s)
--- PASS: TestAccAWSCloudWatchLogGroup_basic (21.93s)
--- PASS: TestAccAWSCloudWatchLogGroup_generatedName (22.74s)
--- PASS: TestAccAWSCloudWatchLogGroup_multiple (25.08s)
--- PASS: TestAccAWSCloudWatchLogGroup_retentionPolicy (34.93s)
--- PASS: TestAccAWSCloudWatchLogGroup_namePrefix_retention (35.11s)
--- PASS: TestAccAWSCloudWatchLogGroup_kmsKey (38.85s)
--- PASS: TestAccAWSCloudWatchLogGroup_tagging (57.51s)

@ghost
Copy link

ghost commented Feb 12, 2021

This has been released in version 3.28.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 for triage. Thanks!

@ghost
Copy link

ghost commented Mar 14, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. 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