Skip to content

[FEAT] CloudFormation: provision the ElastiCache types (CacheCluster, SubnetGroup, User, UserGroup, ServerlessCache) #4650

Closed

Description

@robertjosephwayne

Service

CloudFormation / ElastiCache

API Action / Feature

CloudFormation resource types AWS::ElastiCache::CacheCluster, AWS::ElastiCache::SubnetGroup, AWS::ElastiCache::User, AWS::ElastiCache::UserGroup and AWS::ElastiCache::ServerlessCache.

Checked on Floci 2.1.0 (floci/floci:2.1.0) and on main at 071a170: no provisioner is registered for these types. With FLOCI_SERVICES_CLOUDFORMATION_ALLOW_STUB_UNSUPPORTED_RESOURCE_TYPES=false, the stack rolls back with Resource type <type> is not supported by Floci. With the default (true), the stack reports CREATE_COMPLETE, but nothing is created, and Ref and Fn::GetAtt return stub values.

Service API status on main:

Minimal template:

Resources:
  Vpc:
    Type: AWS::EC2::VPC
    Properties:
      CidrBlock: 10.0.0.0/16
  Subnet:
    Type: AWS::EC2::Subnet
    Properties:
      VpcId: !Ref Vpc
      CidrBlock: 10.0.0.0/24
  SubnetGroup:
    Type: AWS::ElastiCache::SubnetGroup
    Properties:
      Description: example
      SubnetIds: [!Ref Subnet]
  DefaultUser:
    Type: AWS::ElastiCache::User
    Properties:
      UserId: example-default
      UserName: default
      Engine: redis
      AccessString: off -@all
      NoPasswordRequired: true
  AppUser:
    Type: AWS::ElastiCache::User
    Properties:
      UserId: example-app
      UserName: example-app
      Engine: redis
      AccessString: on ~* +@all
      AuthenticationMode:
        Type: password
        Passwords: [example-password-0123456789]
  UserGroup:
    Type: AWS::ElastiCache::UserGroup
    Properties:
      UserGroupId: example-users
      Engine: redis
      UserIds: [!Ref DefaultUser, !Ref AppUser]
  Cluster:
    Type: AWS::ElastiCache::CacheCluster
    Properties:
      Engine: redis
      CacheNodeType: cache.t3.micro
      NumCacheNodes: 1
      CacheSubnetGroupName: !Ref SubnetGroup
  Serverless:
    Type: AWS::ElastiCache::ServerlessCache
    Properties:
      ServerlessCacheName: example-serverless
      Engine: valkey
      SubnetIds: [!Ref Subnet]
      UserGroupId: !Ref UserGroup
Outputs:
  ClusterEndpoint:
    Value: !GetAtt Cluster.RedisEndpoint.Address
  ServerlessEndpoint:
    Value: !GetAtt Serverless.Endpoint.Address
aws --endpoint-url http://localhost:4566 cloudformation create-stack \
  --stack-name elasticache-repro --template-body file://elasticache.yaml

AWS Documentation

Why is this needed?

In AWS CDK, ElastiCache has only L1 constructs (CfnCacheCluster, CfnSubnetGroup, CfnUser, CfnUserGroup, CfnServerlessCache), so every CDK app that declares a Redis or Valkey cache emits these types. In strict mode the stack cannot deploy. In stub mode the application gets a stub value instead of a cache endpoint (RedisEndpoint.Address, Endpoint.Address), so nothing can connect.

Expected, matching AWS:

  • Ref returns the cluster ID, the subnet group name, the user ID, the user group ID and the serverless cache name.
  • Fn::GetAtt returns the endpoint address and port attributes for the cluster and the serverless cache, and Arn for the user, user group and serverless cache.
  • DeleteStack deletes the caches first, then the user group, users and subnet group.

Are you willing to contribute a PR?

  • Yes
  • No

Activity

  1. hectorvent commented on Oct 17, 2026

    @hectorvent
    Member

    All the ElastiCache types listed here are provisioned on main: cache clusters and subnet groups (#5307), users and user groups (#5422), and serverless caches (#5423, on top of the serverless APIs from #5366). Those PRs referenced this issue as "Part of", so it never closed on its own. Closing as done, thanks for the request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions