CloudFormation模板中的Elasticache复制组ID [英] Elasticache replication group id in CloudFormation template

查看:88
本文介绍了CloudFormation模板中的Elasticache复制组ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用CloudFormation模板时如何设置Redis ReplicationGroup ID? docs 中的所有选项均显示无法做到这一点,您可以做到 CLI 这很容易。我的最终目标是拥有一个由3个集群成员组成的Redis复制组,但我想选择名称而不是AWS为我设置一个唯一的名称。

How do you set the Redis ReplicationGroup ID when using a CloudFormation template? All the options in the docs show no way to do that and the CLI you can do this easily. My end goal is to have a Redis replication group with 3 cluster members but I want to choose the name rather than AWS set a unique name for me.

下面是一个片段我的模板:

Here's a snippet of my template:

  "Resources": {
    "mqpReplicationGroup": {
      "Type": "AWS::ElastiCache::ReplicationGroup",
      "Properties": {
        "CacheNodeType": {
          "Ref": "CacheNodeType"
        },
        "CacheSubnetGroupName": {
          "Ref": "CacheSubnets"
        },
        "ReplicationGroupDescription": "Redis Replication Group",
        "Engine": "redis",
        "EngineVersion": {
          "Ref": "RedisVersion"
        },
        "NumCacheClusters": {
          "Ref": "NumberOfCacheNodes"
        },
        "AutoMinorVersionUpgrade": "true",
        "AutomaticFailoverEnabled": "true",
        "PreferredMaintenanceWindow": "sat:09:25-sat:22:30",
        "SnapshotRetentionLimit": "4",
        "SnapshotWindow": "00:05-05:30",
        "NotificationTopicArn": {
          "Fn::Join" :[":",["arn:aws:sns",{ "Ref" : "AWS::Region" },{ "Ref" : "AWS::AccountId" },"service-aws"]]
        },
        "SecurityGroupIds": [
          {
            "Fn::Join": [
              ",",
              {
                "Ref": "VpcSecurityGroupIds"
              }
            ]
          }
        ]
      }
    },
    "CacheSubnets": {
      "Type": "AWS::ElastiCache::SubnetGroup",
      "Properties": {
        "Description": "mqp-cache-subnet",
        "SubnetIds": {
          "Ref": "SubnetIds"
        }
      }
    }
  }


推荐答案

从2017年开始,现在可以使用 ReplicationGroupId 属性。

As of 2017, this is now possible using ReplicationGroupId property.

由于它是可选的,因此AWS CloudFormation仍会生成唯一的物理ID

Since it is optional, AWS CloudFormation will still generate an unique physical ID when not specified.

名称类型


  • 必须包含1到20个字母数字字符或连字符。

  • 第一个字符必须是字母。

  • 不能以连字符结尾或包含两个连续的连字符。

这篇关于CloudFormation模板中的Elasticache复制组ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆