Repository navigation
feat(cloudformation): provision ElastiCache cache clusters and subnet groups - #5307
Conversation
PR Summary by QodoProvision ElastiCache clusters and subnet groups in CloudFormation
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
Code Review by Qodo
1.
|
pgermosen
left a comment
There was a problem hiding this comment.
@vuthehuyht thanks, this is a big one. The red CI comes from the PR itself, in two places.
Checkstyle now enforces import order, and two of the new tests break it: in ElastiCacheCfnIntegrationTest, ElastiCacheException belongs before UserGroupNotFoundException, and in ElastiCacheCfnProvisionerTest the static JUnit import belongs before the Mockito ones.
AwsQueryActionRoutingParityTest wants ElastiCacheServerlessQueryHandler registered, and CreateServerlessCache, DeleteServerlessCache, DescribeServerlessCaches and ModifyServerlessCache added to the ElastiCache set in AwsQueryController. Without that, a request that carries no credential scope routes those actions to SQS.
pgermosen
left a comment
There was a problem hiding this comment.
@vuthehuyht thanks, both are fixed and CI is green.
This bundles two features, though: CloudFormation support for the four types the service already has, and a new serverless cache API (four operations, hidden backing clusters, and its own auth path in the proxy), which is about half the diff and changes the existing cluster code. Could the serverless API go in its own PR with its own issue, so this one keeps the CacheCluster, SubnetGroup, User and UserGroup provisioners? The ServerlessCache provisioner can follow once the API is in.
6b8878d to
4375bb4
Compare
|
Code review by qodo was updated up to the latest commit 4375bb4 |
f56a668 to
3f59ae3
Compare
pgermosen
left a comment
There was a problem hiding this comment.
@vuthehuyht thanks for splitting it, this is much easier to follow.
The new in-use refusal throws CacheSubnetGroupInUseFault, but the model's wire code for that error is CacheSubnetGroupInUse, without the suffix, so SDKs won't map it to their exception; the service and provisioner tests pin the suffixed code too. The Memcached requireCacheSubnetGroup is also a copy of the private one in ElastiCacheService, so one shared helper taking the subnet-group store would cover both.
The registry schema also requires NumCacheNodes on CacheCluster and Description on SubnetGroup, which could be checked the way CacheNodeType now is.
… groups Add AWS::ElastiCache::CacheCluster and AWS::ElastiCache::SubnetGroup provisioners with Ref, Fn::GetAtt endpoint attributes, create-only replacement and update handling. Subnet group updates now carry tags through modifyCacheSubnetGroup, and Memcached clusters record their network type.
…reserve memcached tags
42faba3 to
ab8dbc9
Compare
pgermosen
left a comment
There was a problem hiding this comment.
@vuthehuyht thanks, that covers all three: the wire code, the shared subnet-group check and the required properties. Good to go.
… groups (floci-io#5307) * feat(cloudformation): provision ElastiCache cache clusters and subnet groups Add AWS::ElastiCache::CacheCluster and AWS::ElastiCache::SubnetGroup provisioners with Ref, Fn::GetAtt endpoint attributes, create-only replacement and update handling. Subnet group updates now carry tags through modifyCacheSubnetGroup, and Memcached clusters record their network type. * fix(elasticache): validate cluster name, rollback subnet groups and preserve memcached tags * fix(elasticache): align in-use error wire code and enforce schema required properties Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
|
🎉 This PR is included in version 2.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Provision the
CacheClusterandSubnetGroupElastiCache CloudFormation resource types so stacks create real resources instead of stubs orResource type ... is not supported:AWS::ElastiCache::CacheClusterandAWS::ElastiCache::SubnetGroup(ElastiCacheCfnProvisioner)Refreturns the cluster id and the subnet group name.Fn::GetAttreturnsRedisEndpoint.*for redis and valkey clusters andConfigurationEndpoint.*for memcached. Create-only changes replace the resource and the displaced one is cleaned up after the update.DeleteStackremoves clusters before subnet groups.Two small service changes support the provisioner:
modifyCacheSubnetGroupgains an overload that replaces the stored tags, and Memcached clusters record theirNetworkType(defaultipv4), as redis and valkey clusters already do, so a changed network type is detected as a replacement on both engines.This PR was split from its first version, which also carried the serverless cache API and the
User,UserGroupandServerlessCacheprovisioners, following review feedback. They follow as separate PRs:CreateServerlessCache,DescribeServerlessCaches,ModifyServerlessCache,DeleteServerlessCache)AWS::ElastiCache::UserandAWS::ElastiCache::UserGroupAWS::ElastiCache::ServerlessCache, once the API is inKnown limit: a cache cluster is not modified in place on update (a warning is logged).
Part of #4650
Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
Property names, required properties, create-only properties and
readOnlyPropertiesfollow the registry schemas inlocal/aws/cfn-resource-schemas/us-east-1/aws-elasticache-*.json. The integration test uses AWS SDK for Java v2elasticache2.55.11 (added as a test dependency), not the AWS CLI.Checklist
./mvnw testpasses locally (the full suite was not run; the ElastiCache and CloudFormation tests that do not need Docker pass, exceptCfnSchemaCoverageTest, which fails locally onAWS::CertificateManager::Certificate Idbecause of the local schema directory, unrelated to this PR)