Skip to content

Commit

Permalink
r/aws_elasticache_cluster: Use '_Values()' for enumeration validation (
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Nov 22, 2022
1 parent 595da70 commit 918e348
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions internal/service/elasticache/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,10 @@ func ResourceCluster() *schema.Resource {
ForceNew: true,
},
"az_mode": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{
elasticache.AZModeCrossAz,
elasticache.AZModeSingleAz,
}, false),
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(elasticache.AZMode_Values(), false),
},
"cache_nodes": {
Type: schema.TypeList,
Expand Down Expand Up @@ -129,8 +126,8 @@ func ResourceCluster() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ExactlyOneOf: []string{"engine", "replication_group_id"},
ForceNew: true,
ExactlyOneOf: []string{"engine", "replication_group_id"},
ValidateFunc: validation.StringInSlice(engine_Values(), false),
},
"engine_version": {
Expand All @@ -154,8 +151,8 @@ func ResourceCluster() *schema.Resource {
},
"log_delivery_configuration": {
Type: schema.TypeSet,
Optional: true,
MaxItems: 2,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"destination": {
Expand Down Expand Up @@ -232,8 +229,8 @@ func ResourceCluster() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ExactlyOneOf: []string{"replication_group_id", "engine"},
ForceNew: true,
ExactlyOneOf: []string{"replication_group_id", "engine"},
ValidateFunc: validateReplicationGroupID,
ConflictsWith: []string{
"az_mode",
Expand Down Expand Up @@ -269,9 +266,9 @@ func ResourceCluster() *schema.Resource {
},
"snapshot_arns": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
ForceNew: true,
MaxItems: 1,
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validation.All(
Expand Down

0 comments on commit 918e348

Please sign in to comment.