Skip to content

Commit

Permalink
Merge pull request #34460 from hashicorp/f-elasticache-auth_token_upd…
Browse files Browse the repository at this point in the history
…ate_strategy

r/aws_elasticache_replication_group: add auth_token_update_strategy argument
  • Loading branch information
jar-b authored Nov 21, 2023
2 parents 8ae0507 + 4ef3c76 commit 940196f
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 41 deletions.
3 changes: 3 additions & 0 deletions .changelog/34460.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_elaticache_replication_group: Add `auth_token_update_strategy` argument
```
11 changes: 9 additions & 2 deletions internal/service/elasticache/replication_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ func ResourceReplicationGroup() *schema.Resource {
ValidateFunc: validReplicationGroupAuthToken,
ConflictsWith: []string{"user_group_ids"},
},
"auth_token_update_strategy": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice(elasticache.AuthTokenUpdateStrategyType_Values(), true),
Default: elasticache.AuthTokenUpdateStrategyTypeRotate,
RequiredWith: []string{"auth_token"},
},
"auto_minor_version_upgrade": {
Type: nullable.TypeNullableBool,
Optional: true,
Expand Down Expand Up @@ -855,11 +862,11 @@ func resourceReplicationGroupUpdate(ctx context.Context, d *schema.ResourceData,
}
}

if d.HasChange("auth_token") {
if d.HasChanges("auth_token", "auth_token_update_strategy") {
params := &elasticache.ModifyReplicationGroupInput{
ApplyImmediately: aws.Bool(true),
ReplicationGroupId: aws.String(d.Id()),
AuthTokenUpdateStrategy: aws.String("ROTATE"),
AuthTokenUpdateStrategy: aws.String(d.Get("auth_token_update_strategy").(string)),
AuthToken: aws.String(d.Get("auth_token").(string)),
}

Expand Down
Loading

0 comments on commit 940196f

Please sign in to comment.