Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/aws_elasticache_cluster: Remove deprecated availability_zones argument #7714

Merged
merged 1 commit into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions aws/resource_aws_elasticache_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ func resourceAwsElasticacheCluster() *schema.Resource {
ForceNew: true,
},
"availability_zones": {
Type: schema.TypeSet,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
ConflictsWith: []string{"preferred_availability_zones"},
Deprecated: "Use `preferred_availability_zones` instead",
Type: schema.TypeSet,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
Removed: "Use `preferred_availability_zones` argument instead",
},
"az_mode": {
Type: schema.TypeString,
Expand Down Expand Up @@ -165,7 +164,6 @@ func resourceAwsElasticacheCluster() *schema.Resource {
Optional: true,
ForceNew: true,
ConflictsWith: []string{
"availability_zones",
"az_mode",
"engine_version",
"engine",
Expand Down Expand Up @@ -387,12 +385,6 @@ func resourceAwsElasticacheClusterCreate(d *schema.ResourceData, meta interface{

if v, ok := d.GetOk("preferred_availability_zones"); ok && len(v.([]interface{})) > 0 {
req.PreferredAvailabilityZones = expandStringList(v.([]interface{}))
} else {
preferred_azs := d.Get("availability_zones").(*schema.Set).List()
if len(preferred_azs) > 0 {
azs := expandStringList(preferred_azs)
req.PreferredAvailabilityZones = azs
}
}

id, err := createElasticacheCacheCluster(conn, req)
Expand Down
4 changes: 0 additions & 4 deletions aws/resource_aws_elasticache_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,6 @@ func TestAccAWSElasticacheCluster_ReplicationGroupID_InvalidAttributes(t *testin
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSElasticacheClusterDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSElasticacheClusterConfig_ReplicationGroupID_InvalidAttribute(rName, "availability_zones", "${list(\"us-east-1a\", \"us-east-1c\")}"),
ExpectError: regexp.MustCompile(`"replication_group_id": conflicts with availability_zones`),
},
{
Config: testAccAWSElasticacheClusterConfig_ReplicationGroupID_InvalidAttribute(rName, "az_mode", "single-az"),
ExpectError: regexp.MustCompile(`"replication_group_id": conflicts with az_mode`),
Expand Down
2 changes: 0 additions & 2 deletions website/docs/r/elasticache_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ SNS topic to send ElastiCache notifications to. Example:

* `availability_zone` - (Optional) The Availability Zone for the cache cluster. If you want to create cache nodes in multi-az, use `preferred_availability_zones` instead. Default: System chosen Availability Zone.

* `availability_zones` - (*DEPRECATED*, Optional, Memcached only) Use `preferred_availability_zones` instead unless you want to create cache nodes in single-az, then use `availability_zone`. Set of Availability Zones in which the cache nodes will be created.

* `preferred_availability_zones` - (Optional, Memcached only) A list of the Availability Zones in which cache nodes are created. If you are creating your cluster in an Amazon VPC you can only locate nodes in Availability Zones that are associated with the subnets in the selected subnet group. The number of Availability Zones listed must equal the value of `num_cache_nodes`. If you want all the nodes in the same Availability Zone, use `availability_zone` instead, or repeat the Availability Zone multiple times in the list. Default: System chosen Availability Zones. Detecting drift of existing node availability zone is not currently supported. Updating this argument by itself to migrate existing node availability zones is not currently supported and will show a perpetual difference.

* `tags` - (Optional) A mapping of tags to assign to the resource
Expand Down