AWS cloudformation:创建 AWS::ElastiCache::ReplicationGroup 资源时如何设置集群名称

use*_*052 7 amazon-web-services aws-cloudformation

我的模板中有一个 AWS::ElastiCache::ReplicationGroup 类型的资源。创建堆栈时,它会在创建此集群时分配一个生成的名称。正在使用Redis引擎。对于 AWS::ElastiCache::CacheCluster,有一个名为 ClusterName 的属性具有相同的用途。这里有对应的属性吗?

小智 7

对我来说,设置 ReplicationGroupId 属性是有效的。我使用了一个名为“ClusterName”的输入参数。

Resources:
  RedisReplicationGroup:
    DependsOn: SecurityGroup
    Type: AWS::ElastiCache::ReplicationGroup
    Properties: 
      AtRestEncryptionEnabled: !Ref AtRestEncryptionEnabled
      AuthToken: !Ref AuthToken
      AutomaticFailoverEnabled: !Ref AutomaticFailoverEnabled
      CacheNodeType: !Ref CacheNodeType
      CacheParameterGroupName: !Ref CacheParameterGroupName
      CacheSubnetGroupName: !Ref CacheSubnetGroupName
      Engine: redis
      NumNodeGroups: !Ref NumNodeGroups
      ReplicationGroupId: !Ref ClusterName
      ReplicasPerNodeGroup: !Ref ReplicasPerNodeGroup
      ReplicationGroupDescription: "Redis Cluster"
      SecurityGroupIds: 
        - !Ref SecurityGroup
      Tags:
        - 
          Key: "Environment"
          Value: !Ref EnvironmentTag
        - 
          Key: "Name"
          Value: !Ref ClusterName
        -
          Key: "CreatedBy"
          Value: !Ref CreatedByTag
        -
          Key: "Project"
          Value: !Ref ProjectTag
      TransitEncryptionEnabled: !Ref TransitEncryptionEnabled
Run Code Online (Sandbox Code Playgroud)