Skip to content

Commit

Permalink
feat(elasticache): Make engine name case insensitive for user and use…
Browse files Browse the repository at this point in the history
…r_group

From what I can tell, the name isn't case sensitive, and even if you set it with the uppercase
version, AWS will return the lowercase version (and the diff was already case-insensitive).
  • Loading branch information
tmccombs committed Jan 7, 2025
1 parent 1b77fb6 commit f7fcc74
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changelog/40794.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:enhancement
resource/aws_elasticache_user: engine attribute is now case insensitive
```

```release-note:enhancement
resoruce/aws_elasticache_user_group: engine attribute is now case insensitive
```
2 changes: 1 addition & 1 deletion internal/service/elasticache/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func resourceUser() *schema.Resource {
names.AttrEngine: {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"REDIS", "VALKEY"}, false),
ValidateFunc: validation.StringInSlice([]string{engineRedis, engineValkey}, true),
DiffSuppressFunc: sdkv2.SuppressEquivalentStringCaseInsensitive,
},
"no_password_required": {
Expand Down
2 changes: 1 addition & 1 deletion internal/service/elasticache/user_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func resourceUserGroup() *schema.Resource {
names.AttrEngine: {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"REDIS", "VALKEY"}, false),
ValidateFunc: validation.StringInSlice([]string{engineRedis, engineValkey}, true),
DiffSuppressFunc: sdkv2.SuppressEquivalentStringCaseInsensitive,
},
names.AttrTags: tftags.TagsSchema(),
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/elasticache_user.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "aws_elasticache_user" "test" {
The following arguments are required:

* `access_string` - (Required) Access permissions string used for this user. See [Specifying Permissions Using an Access String](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.RBAC.html#Access-string) for more details.
* `engine` - (Required) The current supported values are `REDIS`, `VALKEY`.
* `engine` - (Required) The current supported values are `REDIS`, `VALKEY` (case insensitive).
* `user_id` - (Required) The ID of the user.
* `user_name` - (Required) The username of the user.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/elasticache_user_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "aws_elasticache_user_group" "test" {

The following arguments are required:

* `engine` - (Required) The current supported value are `REDIS`, `VALKEY`.
* `engine` - (Required) The current supported value are `REDIS`, `VALKEY` (case insensitive).
* `user_group_id` - (Required) The ID of the user group.

The following arguments are optional:
Expand Down

0 comments on commit f7fcc74

Please sign in to comment.