terraform-aws-modules / terraform-aws-elasticache

Terraform module to create AWS ElastiCache resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/elasticache/aws
Apache License 2.0
17 stars 28 forks source link

fix: Remove dots from inter_parameter_group_name #11

Closed mattsafraid closed 3 months ago

mattsafraid commented 4 months ago

Description

Fix an internal local name used to create a Parameter Group Family. Current module breaks when using older families and no declared family name, because old names contain dots in the name and this is not allowed for Parameter Group Family names.

Motivation and Context

Module can't create an internal parameter group name when using older families.

Parameter group families do not follow a very strict naming convention in AWS. There are situations like the following: (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/ParameterGroups.Redis.html)

Redis OSS Version Family name
7 (current) redis7
6 redis6.x
5 redis5.0

Also, AWS enforces naming rules for parameter family creation. Notably, item no.5 declares: (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/ParameterGroups.Creating.html)

Parameter group naming constraints are as follows:

  • Must begin with an ASCII letter.
  • Can only contain ASCII letters, digits, and hyphens.

So when using the module to create an ElastiCache cluster without a custom name, we get the following error:

  Error: creating ElastiCache Parameter Group (redis-dev-redis6.x-ec5a4b07c01ecf4a):
operation error ElastiCache: CreateCacheParameterGroup, https response error StatusCode: 400, 
RequestID: ****, InvalidParameterValue: The parameter CacheParameterGroupName is not a valid identifier. 
Identifiers must begin with a letter; must contain only ASCII letters, digits, and hyphens;
and must not end with a hyphen or contain two consecutive hyphens.

Breaking Changes

No breaking changes

How Has This Been Tested?

antonbabenko commented 3 months ago

This PR is included in version 1.2.1 :tada:

github-actions[bot] commented 2 months ago

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.