AWS - 无法创建 ElastiCache-CacheCluster - “未找到 CacheSecurityGroup 错误”

AWS - 无法创建 ElastiCache-CacheCluster - “未找到 CacheSecurityGroup 错误”

我有一个如下所示的云形成脚本,我希望创建一个安全组和 Elasti Cache。但是我收到如下所示的错误 CREATE_FAILED 未找到 AWS::ElastiCache::CacheCluster CacheSecurityGroup:elasticacheta....

我经常使用 cloudformation,但从不使用缓存。我不想在我的场景中使用 VPC,并且已经阅读了文档http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticache-cache-cluster.html和相关链接,但没有运气 - 感谢帮助。

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  ElasticacheSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: "Access from webservers only"
      SecurityGroupIngress:
      - IpProtocol: tcp
        CidrIp: 0.0.0.0/0
        FromPort: '11211'
        ToPort: '11211'
  ElasticacheCluster:
    Type: "AWS::ElastiCache::CacheCluster"
    DependsOn: ElasticacheSecurityGroup
    Properties:
      AutoMinorVersionUpgrade: "true"
      Engine: "memcached"
      CacheNodeType: "cache.t1.micro"
      NumCacheNodes: "1"
      CacheSecurityGroupNames:
      - Ref: ElasticacheSecurityGroup

答案1

回响乔丹的评论,将资源类型更改为AWS::ElastiCache::SecurityGroup

所以它看起来应该是这样的:

Resources:
  ElasticacheSecurityGroup:
    Type: AWS::ElastiCache::SecurityGroup
    Properties:
      Description: "Access from webservers only"
  ElasticacheCluster:
    Type: "AWS::ElastiCache::CacheCluster"
    DependsOn: ElasticacheSecurityGroup
    Properties:
      AutoMinorVersionUpgrade: "true"
      Engine: "memcached"
      CacheNodeType: "cache.t1.micro"
      NumCacheNodes: "1"
      CacheSecurityGroupNames:
      - Ref: ElasticacheSecurityGroup

相关内容