Skip to content

Conversation

@tabito-hara
Copy link
Contributor

@tabito-hara tabito-hara commented Mar 14, 2025

Description

  • The name_prefix attribute has been implemented for the aws_elasticache_parameter_group resource.
  • Implemented in the same manner as previous PRs (e.g., Add name_prefix support for WAFv2 rule groups #33206) that added name_prefix support for other resources.
  • The name attribute is now optional. If neither name nor name_prefix is specified, a random suffix with the prefix terraform- is generated.
  • While the AWS API documentation does not specify this, the AWS Management Console indicates that the maximum length of parameter group names is 255. Name length validation has been implemented accordingly.
  • Added acctests to confirm:
    • When name_prefix is specified, the parameter group name is generated as name_prefix + UniqueIdSuffix.
    • When neither name nor name_prefix is specified, the parameter group name is generated as terraform- + UniqueIdSuffix.

Verification

  • When running the newly added acctest TestAccElastiCacheParameterGroup_namePrefix, CloudTrail logs confirm that the CreateParameterGroup action was called with the request parameter cacheParameterGroupName set to "tf-acc-test-511342620309676706420250314160149600000000001".
  • When running the newly added acctest TestAccElastiCacheParameterGroup_nameGenerated, CloudTrail logs confirm that the CreateParameterGroup action was called with the request parameter cacheParameterGroupName set to "terraform-20250314153805770600000001".
  • Both results match the expected behavior.
  • The existing acctests confirm that the modifications in this PR do not affect the current behavior.

Relations

Closes #41845

References

Output from Acceptance Testing

$ make testacc TESTS='TestAccElastiCacheParameterGroup_' PKG=elasticache
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-aws_elasticache_parameter_group-add_name_prefix 🌿...
TF_ACC=1 go1.25.5 test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheParameterGroup_'  -timeout 360m -vet=off
2026/01/09 21:59:08 Creating Terraform AWS Provider (SDKv2-style)...
2026/01/09 21:59:08 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccElastiCacheParameterGroup_Redis_basic
=== PAUSE TestAccElastiCacheParameterGroup_Redis_basic
=== RUN   TestAccElastiCacheParameterGroup_Valkey_basic
=== PAUSE TestAccElastiCacheParameterGroup_Valkey_basic
=== RUN   TestAccElastiCacheParameterGroup_disappears
=== PAUSE TestAccElastiCacheParameterGroup_disappears
=== RUN   TestAccElastiCacheParameterGroup_addParameter
=== PAUSE TestAccElastiCacheParameterGroup_addParameter
=== RUN   TestAccElastiCacheParameterGroup_removeAllParameters
=== PAUSE TestAccElastiCacheParameterGroup_removeAllParameters
=== RUN   TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_allParameters
=== PAUSE TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_allParameters
=== RUN   TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_remainingParameters
=== PAUSE TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_remainingParameters
=== RUN   TestAccElastiCacheParameterGroup_switchReservedMemoryParameter
=== PAUSE TestAccElastiCacheParameterGroup_switchReservedMemoryParameter
=== RUN   TestAccElastiCacheParameterGroup_updateReservedMemoryParameter
=== PAUSE TestAccElastiCacheParameterGroup_updateReservedMemoryParameter
=== RUN   TestAccElastiCacheParameterGroup_uppercaseName
=== PAUSE TestAccElastiCacheParameterGroup_uppercaseName
=== RUN   TestAccElastiCacheParameterGroup_description
=== PAUSE TestAccElastiCacheParameterGroup_description
=== RUN   TestAccElastiCacheParameterGroup_namePrefix
=== PAUSE TestAccElastiCacheParameterGroup_namePrefix
=== RUN   TestAccElastiCacheParameterGroup_nameGenerated
=== PAUSE TestAccElastiCacheParameterGroup_nameGenerated
=== RUN   TestAccElastiCacheParameterGroup_tags
=== PAUSE TestAccElastiCacheParameterGroup_tags
=== CONT  TestAccElastiCacheParameterGroup_Redis_basic
=== CONT  TestAccElastiCacheParameterGroup_switchReservedMemoryParameter
=== CONT  TestAccElastiCacheParameterGroup_updateReservedMemoryParameter
=== CONT  TestAccElastiCacheParameterGroup_removeAllParameters
=== CONT  TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_remainingParameters
=== CONT  TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_allParameters
=== CONT  TestAccElastiCacheParameterGroup_Valkey_basic
=== CONT  TestAccElastiCacheParameterGroup_addParameter
=== CONT  TestAccElastiCacheParameterGroup_namePrefix
=== CONT  TestAccElastiCacheParameterGroup_tags
=== CONT  TestAccElastiCacheParameterGroup_disappears
=== CONT  TestAccElastiCacheParameterGroup_nameGenerated
=== CONT  TestAccElastiCacheParameterGroup_uppercaseName
=== CONT  TestAccElastiCacheParameterGroup_description
--- PASS: TestAccElastiCacheParameterGroup_disappears (43.39s)
--- PASS: TestAccElastiCacheParameterGroup_namePrefix (43.44s)
--- PASS: TestAccElastiCacheParameterGroup_nameGenerated (44.10s)
--- PASS: TestAccElastiCacheParameterGroup_description (45.92s)
--- PASS: TestAccElastiCacheParameterGroup_uppercaseName (48.66s)
--- PASS: TestAccElastiCacheParameterGroup_Redis_basic (48.66s)
--- PASS: TestAccElastiCacheParameterGroup_Valkey_basic (48.70s)
--- PASS: TestAccElastiCacheParameterGroup_removeAllParameters (60.39s)
--- PASS: TestAccElastiCacheParameterGroup_addParameter (64.25s)
--- PASS: TestAccElastiCacheParameterGroup_updateReservedMemoryParameter (65.56s)
--- PASS: TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_allParameters (65.57s)
--- PASS: TestAccElastiCacheParameterGroup_switchReservedMemoryParameter (66.23s)
--- PASS: TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_remainingParameters (66.76s)
--- PASS: TestAccElastiCacheParameterGroup_tags (77.02s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elasticache        81.001s

@github-actions
Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • 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 needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/elasticache Issues and PRs that pertain to the elasticache service. size/M Managed by automation to categorize the size of a PR. labels Mar 14, 2025
@tabito-hara tabito-hara force-pushed the f-aws_elasticache_parameter_group-add_name_prefix branch from 789abb6 to e5be0d4 Compare March 14, 2025 16:30
@tabito-hara tabito-hara marked this pull request as ready for review March 14, 2025 17:39
@tabito-hara tabito-hara requested a review from a team as a code owner March 14, 2025 17:39
@justinretzolk justinretzolk 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 Mar 17, 2025
@tabito-hara tabito-hara force-pushed the f-aws_elasticache_parameter_group-add_name_prefix branch from 8095718 to 0ac376d Compare March 20, 2025 17:28
@tabito-hara
Copy link
Contributor Author

Rebase onto the latest main branch and replace interface{} with any to align with the modernization of Go code.

@tabito-hara tabito-hara force-pushed the f-aws_elasticache_parameter_group-add_name_prefix branch from 0ac376d to 2b2f687 Compare August 17, 2025 04:43
@tabito-hara tabito-hara marked this pull request as draft August 17, 2025 04:48
@tabito-hara tabito-hara marked this pull request as ready for review August 17, 2025 05:17
@ksudana
Copy link

ksudana commented Jan 7, 2026

@tabito-hara is this still open?

@tabito-hara
Copy link
Contributor Author

@ksudana

Thank you for your comment.
This PR is still open.

I will rebase this on the latest main branch and resolve conflicts.

@ksudana
Copy link

ksudana commented Jan 9, 2026

Thanks @tabito-hara, if we can get this change in it will be very helpful

@tabito-hara tabito-hara marked this pull request as draft January 9, 2026 12:46
@tabito-hara tabito-hara force-pushed the f-aws_elasticache_parameter_group-add_name_prefix branch from c624339 to ebbf2fe Compare January 9, 2026 13:01
@tabito-hara tabito-hara marked this pull request as ready for review January 9, 2026 13:02
@tabito-hara
Copy link
Contributor Author

Rebased on the latest branch , resolving conflicts.
Reran the acceptance tests.

@tabito-hara tabito-hara marked this pull request as draft January 9, 2026 13:02
@tabito-hara tabito-hara marked this pull request as ready for review January 9, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service. size/M 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_elasticache_parameter_group name_prefix

3 participants