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: Migrate from availability_zones TypeSet attribute to preferred_availability_zones TypeList attribute #4741

Merged
merged 2 commits into from
Jun 13, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jun 4, 2018

Fixes #2658
Fixes #374
Fixes #207

Changes proposed in this pull request:

  • Deprecate availability_zones (TypeSet) attribute in aws_elasticache_cluster
  • Create preferred_availability_zones (TypeList) attribute in aws_elasticache_cluster
  • Support NewAvailabilityZones parameter in ModifyCacheCluster when increasing num_cache_nodes with preferred_availability_zones
  • Add acceptance test to cover increasing num_cache_nodes while utilizing preferred_availability_zones

We must create a new attribute because there is no way to migrate state from TypeSet to TypeList without breaking existing configurations, so we will allow an opt-in upgrade procedure and phase out the old attribute. I'm indifferent with the new attribute naming so suggestions welcome (we've used ordered_X for other migrations like this, but preferred_ here does match the CreateCacheCluster parameter PreferredAvailabilityZones).

Output from acceptance testing:

20 tests passed (all tests)
=== RUN   TestAccAWSElasticacheCluster_ReplicationGroupID_InvalidAttributes
--- PASS: TestAccAWSElasticacheCluster_ReplicationGroupID_InvalidAttributes (3.51s)
=== RUN   TestAccAWSElasticacheCluster_NumCacheNodes_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_NumCacheNodes_Redis_Ec2Classic (3.58s)
=== RUN   TestAccAWSElasticacheCluster_AZMode_Memcached_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_AZMode_Memcached_Ec2Classic (443.83s)
=== RUN   TestAccAWSElasticacheCluster_AZMode_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_AZMode_Redis_Ec2Classic (493.62s)
=== RUN   TestAccAWSElasticacheCluster_SecurityGroup
--- PASS: TestAccAWSElasticacheCluster_SecurityGroup (529.19s)
=== RUN   TestAccAWSElasticacheCluster_Engine_Memcached_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_Engine_Memcached_Ec2Classic (535.47s)
=== RUN   TestAccAWSElasticacheCluster_Engine_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_Engine_Redis_Ec2Classic (546.33s)
=== RUN   TestAccAWSElasticacheCluster_Port_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_Port_Ec2Classic (556.38s)
=== RUN   TestAccAWSElasticacheCluster_vpc
--- PASS: TestAccAWSElasticacheCluster_vpc (829.40s)
=== RUN   TestAccAWSElasticacheCluster_multiAZInVpc
--- PASS: TestAccAWSElasticacheCluster_multiAZInVpc (848.69s)
=== RUN   TestAccAWSElasticacheCluster_NodeTypeResize_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_NodeTypeResize_Redis_Ec2Classic (891.39s)
=== RUN   TestAccAWSElasticacheCluster_NodeTypeResize_Memcached_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_NodeTypeResize_Memcached_Ec2Classic (938.32s)
=== RUN   TestAccAWSElasticacheCluster_NumCacheNodes_Decrease
--- PASS: TestAccAWSElasticacheCluster_NumCacheNodes_Decrease (1093.41s)
=== RUN   TestAccAWSElasticacheCluster_NumCacheNodes_IncreaseWithPreferredAvailabilityZones
--- PASS: TestAccAWSElasticacheCluster_NumCacheNodes_IncreaseWithPreferredAvailabilityZones (1094.63s)
=== RUN   TestAccAWSElasticacheCluster_EngineVersion_Memcached_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_EngineVersion_Memcached_Ec2Classic (1107.33s)
=== RUN   TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica_Ec2Classic (1121.69s)
=== RUN   TestAccAWSElasticacheCluster_ReplicationGroupID_MultipleReplica_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_ReplicationGroupID_MultipleReplica_Ec2Classic (1122.54s)
=== RUN   TestAccAWSElasticacheCluster_EngineVersion_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_EngineVersion_Redis_Ec2Classic (1145.84s)
=== RUN   TestAccAWSElasticacheCluster_NumCacheNodes_Increase
--- PASS: TestAccAWSElasticacheCluster_NumCacheNodes_Increase (1174.01s)
=== RUN   TestAccAWSElasticacheCluster_snapshotsWithUpdates
--- PASS: TestAccAWSElasticacheCluster_snapshotsWithUpdates (2146.12s)

…eSet attribute to preferred_availability_zones TypeList attribute
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service. labels Jun 4, 2018
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Jun 4, 2018
… and use preferred_availability_zones in multi-az test
@bflad bflad requested a review from a team June 4, 2018 19:32
@@ -180,6 +180,9 @@ func resourceAwsElasticacheCluster() *schema.Resource {
ForceNew: true,
}

resourceSchema["availability_zones"].ConflictsWith = []string{"preferred_availability_zones"}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created #4828 to fully expand the resource schemas rather than continue with this generated approach.

@bflad bflad added this to the v1.23.0 milestone Jun 13, 2018
@bflad bflad merged commit 6d0e517 into master Jun 13, 2018
@bflad bflad deleted the f-aws_elasticache_cluster-preferred_availability_zones branch June 13, 2018 16:27
bflad added a commit that referenced this pull request Jun 13, 2018
bflad added a commit that referenced this pull request Jun 13, 2018
bflad added a commit that referenced this pull request Jun 13, 2018
@bflad
Copy link
Contributor Author

bflad commented Jun 14, 2018

This has been released in version 1.23.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
2 participants