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

[Enhancement] : Validation function for RDS performance_insights_retention_period attribute #35870

Merged
merged 5 commits into from
Feb 20, 2024

Conversation

Jebaseelanravi
Copy link
Contributor

Description

The valid values for the performance insights retention period are 7, 731 (2 years) or a multiple of 31. This is properly documented. However, in case of an invalid value terraform plan does not complain, you will get the error only after trying to apply the change.

Terraform will perform the following actions:

  # module.db.aws_db_instance.this will be updated in-place
  ~ resource "aws_db_instance" "this" {
        id                                    = "db-XXXXXX"
      ~ performance_insights_retention_period = 7 -> 8
        tags                                  = {
            "Name" = "db-dev"
        }
        # (56 unchanged attributes hidden)
    }

Relations

Closes #34342

References

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#performance_insights_retention_period

Output from Acceptance Testing

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/rds Issues and PRs that pertain to the rds service. labels Feb 17, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 17, 2024
@Jebaseelanravi Jebaseelanravi changed the title [Enhancement] : Check for valid values of performance_insights_retention_period [Enhancement] : Validation function for performance_insights_retention_period attribute Feb 17, 2024
@Jebaseelanravi Jebaseelanravi marked this pull request as ready for review February 17, 2024 23:35
@Jebaseelanravi Jebaseelanravi changed the title [Enhancement] : Validation function for performance_insights_retention_period attribute [Enhancement] : Validation function for RDS performance_insights_retention_period attribute Feb 18, 2024
@ewbankkit ewbankkit 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 20, 2024
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccRDSInstance_PerformanceInsights\|TestAccRDSInstance_basic' PKG=rds ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3  -run=TestAccRDSInstance_PerformanceInsights\|TestAccRDSInstance_basic -timeout 360m
=== RUN   TestAccRDSInstance_basic
=== PAUSE TestAccRDSInstance_basic
=== RUN   TestAccRDSInstance_PerformanceInsights_disabledToEnabled
=== PAUSE TestAccRDSInstance_PerformanceInsights_disabledToEnabled
=== RUN   TestAccRDSInstance_PerformanceInsights_enabledToDisabled
=== PAUSE TestAccRDSInstance_PerformanceInsights_enabledToDisabled
=== RUN   TestAccRDSInstance_PerformanceInsights_kmsKeyID
=== PAUSE TestAccRDSInstance_PerformanceInsights_kmsKeyID
=== RUN   TestAccRDSInstance_PerformanceInsights_retentionPeriod
=== PAUSE TestAccRDSInstance_PerformanceInsights_retentionPeriod
=== CONT  TestAccRDSInstance_basic
=== CONT  TestAccRDSInstance_PerformanceInsights_kmsKeyID
=== CONT  TestAccRDSInstance_PerformanceInsights_enabledToDisabled
--- PASS: TestAccRDSInstance_basic (510.57s)
=== CONT  TestAccRDSInstance_PerformanceInsights_disabledToEnabled
--- PASS: TestAccRDSInstance_PerformanceInsights_enabledToDisabled (857.28s)
=== CONT  TestAccRDSInstance_PerformanceInsights_retentionPeriod
--- PASS: TestAccRDSInstance_PerformanceInsights_kmsKeyID (1037.58s)
--- PASS: TestAccRDSInstance_PerformanceInsights_disabledToEnabled (726.33s)
--- PASS: TestAccRDSInstance_PerformanceInsights_retentionPeriod (785.40s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	1654.292s

@ewbankkit
Copy link
Contributor

@Jebaseelanravi Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 6d5176f into hashicorp:main Feb 20, 2024
26 checks passed
@github-actions github-actions bot added this to the v5.38.0 milestone Feb 20, 2024
Copy link

This functionality has been released in v5.38.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!

fnaranjo-vmw added a commit to cloudfoundry/csb-brokerpak-aws that referenced this pull request Feb 26, 2024
[#187103734](https://www.pivotaltracker.com/story/show/187103734)

Recently, a new PR for validating this property was merged:
hashicorp/terraform-provider-aws#35870

I believe it's valuable to have our tests break when changes
like this are introduced in the providers. Therefore, we should
try have behaviours such as this encoded in our tests. Things
like: "invalid values for property X are not validated by TF".
fnaranjo-vmw added a commit to cloudfoundry/csb-brokerpak-aws that referenced this pull request Feb 26, 2024
[#187103734](https://www.pivotaltracker.com/story/show/187103734)

Recently, a new PR for validating this property was merged:
hashicorp/terraform-provider-aws#35870

I believe it's valuable to have our tests break when changes
like this are introduced in the providers. Therefore, we should
try have behaviours such as this encoded in our tests. Things
like: "invalid values for property X are not validated by TF".
fnaranjo-vmw added a commit to cloudfoundry/csb-brokerpak-aws that referenced this pull request Feb 26, 2024
[#187103734](https://www.pivotaltracker.com/story/show/187103734)

Recently, a new PR for validating this property was merged:
hashicorp/terraform-provider-aws#35870

I believe it's valuable to have our tests break when changes
like this are introduced in the providers. Therefore, we should
try have behaviours such as this encoded in our tests. Things
like: "invalid values for property X are not validated by TF".
fnaranjo-vmw added a commit to cloudfoundry/csb-brokerpak-aws that referenced this pull request Feb 26, 2024
[#187103734](https://www.pivotaltracker.com/story/show/187103734)

Recently, a new PR for validating this property was merged:
hashicorp/terraform-provider-aws#35870

I believe it's valuable to have our tests break when changes
like this are introduced in the providers. Therefore, we should
try have behaviours such as this encoded in our tests. Things
like: "invalid values for property X are not validated by TF".
Copy link

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.
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 Mar 25, 2024
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. service/rds Issues and PRs that pertain to the rds service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: AWS RDS: Check for valid values of performance_insights_retention_period during plan
2 participants