Skip to content

Commit

Permalink
Merge pull request #33704 from autotune/f-rds-validation
Browse files Browse the repository at this point in the history
Allow periods in parameter group names for RDS
  • Loading branch information
jar-b authored Oct 11, 2023
2 parents 185454b + decb2b6 commit e93a9a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changelog/33704.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:bug
resource/aws_db_parameter_group: Group names containing periods (`.`) no longer fail validation
```
```release-note:bug
resource/aws_rds_cluster_parameter_group: Group names containing periods (`.`) no longer fail validation
```
4 changes: 2 additions & 2 deletions internal/service/rds/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ func validOptionGroupNamePrefix(v interface{}, k string) (ws []string, errors []

func validParamGroupName(v interface{}, k string) (ws []string, errors []error) {
value := v.(string)
if !regexache.MustCompile(`^[0-9a-z-]+$`).MatchString(value) {
if !regexache.MustCompile(`^[0-9a-z.-]+$`).MatchString(value) {
errors = append(errors, fmt.Errorf(
"only lowercase alphanumeric characters and hyphens allowed in parameter group %q", k))
"only lowercase alphanumeric characters, periods, and hyphens allowed in parameter group %q", k))
}
if !regexache.MustCompile(`^[a-z]`).MatchString(value) {
errors = append(errors, fmt.Errorf(
Expand Down
4 changes: 4 additions & 0 deletions internal/service/rds/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ func TestValidParamGroupName(t *testing.T) {
Value string
ErrCount int
}{
{
Value: "default.postgres9.6",
ErrCount: 0,
},
{
Value: "tEsting123",
ErrCount: 1,
Expand Down

0 comments on commit e93a9a1

Please sign in to comment.