-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
elasticache: Adds Redis 6.x support #18920
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a couple comments on style that may not be applicable.
@@ -268,32 +275,37 @@ func resourceAwsElasticacheCluster() *schema.Resource { | |||
return errors.New(`az_mode "cross-az" is not supported with num_cache_nodes = 1`) | |||
}, | |||
func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would help with readability here to define all the functions and then list them here by name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've been thinking about that. It would also make them testable if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also really easy to miss the one named function among all the inline functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually did that exact thing on my first read-through :-)
@@ -301,6 +308,9 @@ func resourceAwsElasticacheReplicationGroup() *schema.Resource { | |||
} | |||
return nil | |||
}, | |||
|
|||
CustomizeDiffElastiCacheEngineVersion, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with this sequence for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSElasticacheCluster -timeout 180m
=== RUN TestAccAWSElasticacheCluster_Engine_Memcached
=== PAUSE TestAccAWSElasticacheCluster_Engine_Memcached
=== RUN TestAccAWSElasticacheCluster_Engine_Redis
=== PAUSE TestAccAWSElasticacheCluster_Engine_Redis
=== RUN TestAccAWSElasticacheCluster_Port_Redis_Default
=== PAUSE TestAccAWSElasticacheCluster_Port_Redis_Default
=== RUN TestAccAWSElasticacheCluster_ParameterGroupName_Default
=== PAUSE TestAccAWSElasticacheCluster_ParameterGroupName_Default
=== RUN TestAccAWSElasticacheCluster_Port
=== PAUSE TestAccAWSElasticacheCluster_Port
=== RUN TestAccAWSElasticacheCluster_SecurityGroup_Ec2Classic
=== PAUSE TestAccAWSElasticacheCluster_SecurityGroup_Ec2Classic
=== RUN TestAccAWSElasticacheCluster_snapshotsWithUpdates
=== PAUSE TestAccAWSElasticacheCluster_snapshotsWithUpdates
=== RUN TestAccAWSElasticacheCluster_NumCacheNodes_Decrease
=== PAUSE TestAccAWSElasticacheCluster_NumCacheNodes_Decrease
=== RUN TestAccAWSElasticacheCluster_NumCacheNodes_Increase
=== PAUSE TestAccAWSElasticacheCluster_NumCacheNodes_Increase
=== RUN TestAccAWSElasticacheCluster_NumCacheNodes_IncreaseWithPreferredAvailabilityZones
=== PAUSE TestAccAWSElasticacheCluster_NumCacheNodes_IncreaseWithPreferredAvailabilityZones
=== RUN TestAccAWSElasticacheCluster_vpc
=== PAUSE TestAccAWSElasticacheCluster_vpc
=== RUN TestAccAWSElasticacheCluster_multiAZInVpc
=== PAUSE TestAccAWSElasticacheCluster_multiAZInVpc
=== RUN TestAccAWSElasticacheCluster_AZMode_Memcached
=== PAUSE TestAccAWSElasticacheCluster_AZMode_Memcached
=== RUN TestAccAWSElasticacheCluster_AZMode_Redis
=== PAUSE TestAccAWSElasticacheCluster_AZMode_Redis
=== RUN TestAccAWSElasticacheCluster_EngineVersion_Memcached
=== PAUSE TestAccAWSElasticacheCluster_EngineVersion_Memcached
=== RUN TestAccAWSElasticacheCluster_EngineVersion_Redis
=== PAUSE TestAccAWSElasticacheCluster_EngineVersion_Redis
=== RUN TestAccAWSElasticacheCluster_NodeTypeResize_Memcached
=== PAUSE TestAccAWSElasticacheCluster_NodeTypeResize_Memcached
=== RUN TestAccAWSElasticacheCluster_NodeTypeResize_Redis
=== PAUSE TestAccAWSElasticacheCluster_NodeTypeResize_Redis
=== RUN TestAccAWSElasticacheCluster_NumCacheNodes_Redis
=== PAUSE TestAccAWSElasticacheCluster_NumCacheNodes_Redis
=== RUN TestAccAWSElasticacheCluster_ReplicationGroupID_AvailabilityZone
=== PAUSE TestAccAWSElasticacheCluster_ReplicationGroupID_AvailabilityZone
=== RUN TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica
=== PAUSE TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica
=== RUN TestAccAWSElasticacheCluster_ReplicationGroupID_MultipleReplica
=== PAUSE TestAccAWSElasticacheCluster_ReplicationGroupID_MultipleReplica
=== RUN TestAccAWSElasticacheCluster_Memcached_FinalSnapshot
=== PAUSE TestAccAWSElasticacheCluster_Memcached_FinalSnapshot
=== RUN TestAccAWSElasticacheCluster_Redis_FinalSnapshot
=== PAUSE TestAccAWSElasticacheCluster_Redis_FinalSnapshot
=== CONT TestAccAWSElasticacheCluster_Engine_Memcached
=== CONT TestAccAWSElasticacheCluster_Redis_FinalSnapshot
=== CONT TestAccAWSElasticacheCluster_AZMode_Memcached
=== CONT TestAccAWSElasticacheCluster_SecurityGroup_Ec2Classic
=== CONT TestAccAWSElasticacheCluster_multiAZInVpc
=== CONT TestAccAWSElasticacheCluster_Memcached_FinalSnapshot
=== CONT TestAccAWSElasticacheCluster_snapshotsWithUpdates
=== CONT TestAccAWSElasticacheCluster_ReplicationGroupID_MultipleReplica
=== CONT TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica
=== CONT TestAccAWSElasticacheCluster_ReplicationGroupID_AvailabilityZone
=== CONT TestAccAWSElasticacheCluster_NumCacheNodes_Redis
=== CONT TestAccAWSElasticacheCluster_NodeTypeResize_Redis
=== CONT TestAccAWSElasticacheCluster_NodeTypeResize_Memcached
=== CONT TestAccAWSElasticacheCluster_EngineVersion_Redis
=== CONT TestAccAWSElasticacheCluster_EngineVersion_Memcached
=== CONT TestAccAWSElasticacheCluster_Port_Redis_Default
=== CONT TestAccAWSElasticacheCluster_ParameterGroupName_Default
=== CONT TestAccAWSElasticacheCluster_AZMode_Redis
=== CONT TestAccAWSElasticacheCluster_Engine_Redis
=== CONT TestAccAWSElasticacheCluster_Port
--- PASS: TestAccAWSElasticacheCluster_NumCacheNodes_Redis (4.63s)
=== CONT TestAccAWSElasticacheCluster_NumCacheNodes_IncreaseWithPreferredAvailabilityZones
--- PASS: TestAccAWSElasticacheCluster_Memcached_FinalSnapshot (5.01s)
=== CONT TestAccAWSElasticacheCluster_vpc
--- PASS: TestAccAWSElasticacheCluster_Port_Redis_Default (475.17s)
=== CONT TestAccAWSElasticacheCluster_NumCacheNodes_Increase
--- PASS: TestAccAWSElasticacheCluster_SecurityGroup_Ec2Classic (561.43s)
=== CONT TestAccAWSElasticacheCluster_NumCacheNodes_Decrease
--- PASS: TestAccAWSElasticacheCluster_Engine_Redis (598.55s)
--- PASS: TestAccAWSElasticacheCluster_ParameterGroupName_Default (607.56s)
--- PASS: TestAccAWSElasticacheCluster_AZMode_Redis (622.46s)
--- PASS: TestAccAWSElasticacheCluster_Port (624.21s)
--- PASS: TestAccAWSElasticacheCluster_AZMode_Memcached (624.75s)
--- PASS: TestAccAWSElasticacheCluster_Engine_Memcached (628.20s)
--- PASS: TestAccAWSElasticacheCluster_vpc (656.56s)
--- PASS: TestAccAWSElasticacheCluster_multiAZInVpc (706.65s)
--- PASS: TestAccAWSElasticacheCluster_snapshotsWithUpdates (707.94s)
--- PASS: TestAccAWSElasticacheCluster_Redis_FinalSnapshot (809.49s)
--- PASS: TestAccAWSElasticacheCluster_NumCacheNodes_IncreaseWithPreferredAvailabilityZones (1117.90s)
--- PASS: TestAccAWSElasticacheCluster_NodeTypeResize_Memcached (1227.77s)
--- PASS: TestAccAWSElasticacheCluster_ReplicationGroupID_AvailabilityZone (1369.45s)
--- PASS: TestAccAWSElasticacheCluster_NodeTypeResize_Redis (1369.98s)
--- PASS: TestAccAWSElasticacheCluster_EngineVersion_Memcached (1395.04s)
--- PASS: TestAccAWSElasticacheCluster_ReplicationGroupID_MultipleReplica (1434.90s)
--- PASS: TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica (1435.60s)
--- PASS: TestAccAWSElasticacheCluster_NumCacheNodes_Decrease (897.34s)
--- PASS: TestAccAWSElasticacheCluster_NumCacheNodes_Increase (1019.81s)
--- PASS: TestAccAWSElasticacheCluster_EngineVersion_Redis (2091.81s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 2091.853s
…ne_version` parameter
…he_replication_group`
…n_group` validation functions
e0bd7b4
to
71baa83
Compare
This has been released in version 3.38.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Adds support for specifying Redis version 6.x. This was due to a change in how AWS specifies Redis versions: prior to version 6, the full version was specified, e.g. 5.0.6. Staring with version 6, only the major version is specified followed by
.x
. The AWS API, however, returns the full deployed version in the corresponding parameter, leading to perpetualplan
differences.This PR adds validation and handling to the
engine_version
parameter to specify it as needed by the API. It also adds the parameterengine_version_actual
to output the actual in-use version. Additionally, inaws_elasticache_global_replication_group
, it deprecatesactual_engine_version
in favour ofengine_version_actual
.Closes #15625
Closes #18539
Output from acceptance testing:
TestAccAWSElasticacheGlobalReplicationGroup_ReplaceSecondary_DifferentRegion
failed with an unrelated error:Error creating VPC: VpcLimitExceeded: The maximum number of VPCs has been reached.