0

CloudFormation에 이상한 문제가 있거나 버그가있는 것으로 보입니다.Cloudformation - ElastiCache :: SubnetGroup이 자원 이름을 사용하지 않음

내가 가지고있는 다음과 같은 템플릿 (발췌) 두 개의 서브넷을 정의하고 다음과 같은 서브넷 그룹 : 모든 자원이 아직 만들어

...

"redissubnet1": { 
    "Type": "AWS::EC2::Subnet", 
    "Properties": { 
    "CidrBlock": "10.0.8.0/24", 
    "AvailabilityZone": "us-east-1c", 
    "VpcId": { 
     "Ref": "myVPC" 
    }, 
    "Tags": [ 
     { 
     "Key": "Name", 
     "Value": "redissubnet1" 
     } 
    ] 
    } 
}, 
"redissubnet2": { 
    "Type": "AWS::EC2::Subnet", 
    "Properties": { 
    "CidrBlock": "10.0.9.0/24", 
    "AvailabilityZone": "us-east-1c", 
    "VpcId": { 
     "Ref": "myVPC" 
    }, 
    "Tags": [ 
     { 
     "Key": "Name", 
     "Value": "redissubnet2" 
     } 
    ] 
    } 
}, 
"SubnetGroupName": { 
    "Type": "AWS::ElastiCache::SubnetGroup", 
    "Properties": { 
    "Description": "Subnet group for main application redis elastic cache", 
    "SubnetIds": [ 
     { 
     "Ref": "redissubnet1" 
     }, 
     { 
     "Ref": "redissubnet2" 
     } 
    ] 
    } 
} 

... SubnetGroup 이름 - "SubnetGroupName"-이 적용되지 않습니다. AWS는 [a-z] - [a-z] - [a-z0-9] 형식의 이름을 자동 할당합니다.

누구에게이 문제가 발생 했습니까?

실제로 내가하려고하는 것은 ElastiCache :: Cluster를 생성 할 때 이름으로이 서브넷 그룹을 참조하는 것입니다. 그러나 자원 이름이 존중되지 않기 때문에 그렇게 할 수 없습니다.

누구든지 아이디어가 있습니까? 모든 도움은 감사받은 :

+0

는 HAH, 자신을 해결했다. 대답은 서브넷 그룹 이름을 참조하는 것입니다. 아래의 전체 스 니펫 –

답변

0

대답 탄성 캐시 자원에 서브넷 그룹 이름을 참조하는 것이 었습니다, 다음과 같이

{ 
"subnet1": { 
    "Type": "AWS::EC2::Subnet", 
    "Properties": { 
     "CidrBlock": "10.0.8.0/24", 
     "AvailabilityZone": "us-east-1c", 
     "VpcId": { 
      "Ref": "myVPC" 
     }, 
     "Tags": [{ 
      "Key": "Name", 
      "Value": "subnet1" 
     }] 
    } 
}, 
"subnet2": { 
    "Type": "AWS::EC2::Subnet", 
    "Properties": { 
     "CidrBlock": "10.0.9.0/24", 
     "AvailabilityZone": "us-east-1c", 
     "VpcId": { 
      "Ref": "myVPC" 
     }, 
     "Tags": [{ 
      "Key": "Name", 
      "Value": "subnet2" 
     }] 
    } 
}, 
"redis1": { 
    "Type": "AWS::ElastiCache::SubnetGroup", 
    "Properties": { 
     "Description": "Subnet group for main application redis elastic cache", 
     "SubnetIds": [{ 
      "Ref": "subnet1" 
     }, { 
      "Ref": "subnet2" 
     }] 
    } 
}, 
"mainredis": { 
    "Type": "AWS::ElastiCache::CacheCluster", 
    "Properties": { 
     "AutoMinorVersionUpgrade": "true", 
     "CacheNodeType": "cache.t2.small", 
     "CacheSubnetGroupName": { 
      "Ref": "redis1" 
     }, 
     "ClusterName": "mainredis", 
     "Engine": "redis", 
     "NumCacheNodes": "1", 
     "Port": "6379", 
     "Tags": [{ 
      "Key": "Name", 
      "Value": "mainredis" 
     }, { 
      "Key": "Function", 
      "Value": "Main redis store" 
     }], 
     "VpcSecurityGroupIds": [ 
      "redissecuritygroup" 
     ] 
    } 
    } 
} 
관련 문제