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

fix: add validation to passwords field of elasticache replication group #24274

Conversation

scottd018
Copy link
Contributor

This PR adds in the validation logic using existing validation with the SDK to validate that a user password for an elasticache cluster is within a specific range. Without this, a module may fail after initial validation which is especially problematic for long running Terraform scripts.

Signed-off-by: Dustin Scott sdustin@vmware.com

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

Closes #24273

Output from acceptance testing:

$ make testacc TESTS=TestAccElastiCacheUser_* PKG=elasticache
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheUser_*'  -timeout 180m
=== RUN   TestAccElastiCacheUserDataSource_basic
=== PAUSE TestAccElastiCacheUserDataSource_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_basic
=== PAUSE TestAccElastiCacheUserGroupAssociation_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_update
=== PAUSE TestAccElastiCacheUserGroupAssociation_update
=== RUN   TestAccElastiCacheUserGroupAssociation_disappears
=== PAUSE TestAccElastiCacheUserGroupAssociation_disappears
=== RUN   TestAccElastiCacheUserGroup_basic
=== PAUSE TestAccElastiCacheUserGroup_basic
=== RUN   TestAccElastiCacheUserGroup_update
=== PAUSE TestAccElastiCacheUserGroup_update
=== RUN   TestAccElastiCacheUserGroup_tags
=== PAUSE TestAccElastiCacheUserGroup_tags
=== RUN   TestAccElastiCacheUserGroup_disappears
=== PAUSE TestAccElastiCacheUserGroup_disappears
=== RUN   TestAccElastiCacheUser_basic
=== PAUSE TestAccElastiCacheUser_basic
=== RUN   TestAccElastiCacheUser_update
=== PAUSE TestAccElastiCacheUser_update
=== RUN   TestAccElastiCacheUser_tags
=== PAUSE TestAccElastiCacheUser_tags
=== RUN   TestAccElastiCacheUser_disappears
=== PAUSE TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUserDataSource_basic
=== CONT  TestAccElastiCacheUser_basic
=== CONT  TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUser_update
=== CONT  TestAccElastiCacheUserGroup_update
=== CONT  TestAccElastiCacheUserGroup_tags
=== CONT  TestAccElastiCacheUser_tags
=== CONT  TestAccElastiCacheUserGroup_basic
=== CONT  TestAccElastiCacheUserGroup_disappears
=== CONT  TestAccElastiCacheUserGroupAssociation_update
=== CONT  TestAccElastiCacheUserGroupAssociation_disappears
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
--- PASS: TestAccElastiCacheUser_basic (81.37s)
--- PASS: TestAccElastiCacheUserDataSource_basic (82.32s)
--- PASS: TestAccElastiCacheUser_disappears (104.62s)
--- PASS: TestAccElastiCacheUser_tags (144.28s)
--- PASS: TestAccElastiCacheUser_update (145.23s)
--- PASS: TestAccElastiCacheUserGroup_disappears (208.57s)
--- PASS: TestAccElastiCacheUserGroup_basic (210.24s)
--- PASS: TestAccElastiCacheUserGroup_tags (269.85s)
--- PASS: TestAccElastiCacheUserGroupAssociation_basic (334.15s)
--- PASS: TestAccElastiCacheUserGroupAssociation_disappears (334.54s)
--- PASS: TestAccElastiCacheUserGroup_update (335.89s)
--- PASS: TestAccElastiCacheUserGroupAssociation_update (459.19s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elasticache        461.141s

Signed-off-by: Dustin Scott <sdustin@vmware.com>
@github-actions github-actions bot 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/elasticache Issues and PRs that pertain to the elasticache service. labels Apr 15, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @scottd018 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@DrFaust92 DrFaust92 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 Apr 16, 2022
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 TESTS=TestAccElastiCacheUser_ PKG=elasticache ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 2 -run='TestAccElastiCacheUser_'  -timeout 180m
=== RUN   TestAccElastiCacheUser_basic
=== PAUSE TestAccElastiCacheUser_basic
=== RUN   TestAccElastiCacheUser_update
=== PAUSE TestAccElastiCacheUser_update
=== RUN   TestAccElastiCacheUser_tags
=== PAUSE TestAccElastiCacheUser_tags
=== RUN   TestAccElastiCacheUser_disappears
=== PAUSE TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUser_basic
=== CONT  TestAccElastiCacheUser_tags
--- PASS: TestAccElastiCacheUser_basic (78.56s)
=== CONT  TestAccElastiCacheUser_disappears
--- PASS: TestAccElastiCacheUser_tags (84.54s)
=== CONT  TestAccElastiCacheUser_update
--- PASS: TestAccElastiCacheUser_disappears (71.48s)
--- PASS: TestAccElastiCacheUser_update (124.47s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	216.950s

@ewbankkit
Copy link
Contributor

@scottd018 Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 267aca0 into hashicorp:main Apr 18, 2022
@github-actions github-actions bot added this to the v4.11.0 milestone Apr 18, 2022
@scottd018
Copy link
Contributor Author

Thanks @ewbankkit !

@github-actions
Copy link

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

@github-actions
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 May 23, 2022
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/elasticache Issues and PRs that pertain to the elasticache service. 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.

Validate elasticache user password is between 16-128
3 participants