【问题标题】:Elasticache replication group id in CloudFormation templateCloudFormation 模板中的 Elasticache 复制组 ID
【发布时间】:2015-12-08 09:33:24
【问题描述】:

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

这是我的模板的 sn-p:

  "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"
        }
      }
    }
  }

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation amazon-elasticache


    【解决方案1】:

    截至 2017 年,现在可以使用 ReplicationGroupId 属性来实现。

    由于是可选的,AWS CloudFormation 在未指定时仍会生成唯一的物理 ID。

    Name Type 的限制:

    • 必须包含 1 到 20 个字母数字字符或连字符。
    • 第一个字符必须是字母。
    • 不能以连字符结尾或包含两个连续的连字符。

    【讨论】:

    • 这 20 个字符的限制是否仍然存在?文档现在没有提到它。
    • @jocull 20 个字符的限制仍然有效。
    【解决方案2】:

    这目前无法通过 CloudFormation 完成。

    【讨论】:

      猜你喜欢
      • 2022-01-26
      • 2020-02-06
      • 2021-09-02
      • 2021-03-20
      • 2019-08-26
      • 1970-01-01
      • 2018-06-14
      • 2020-02-09
      • 1970-01-01
      相关资源
      最近更新 更多