CloudFomration을 사용하여 ElasticCache memcached 리소스를 생성하고 있습니다. 하지만 템플릿을 배포 할 때 실패합니다.
이것은 내 템플릿입니다
ElasticCacheSubnetGroup:
Type: AWS::RDS::DBSubnetGroup
Properties:
DBSubnetGroupDescription: Subnet Group to specify the subnets for elastic cache
SubnetIds:
- !Ref DatabaseSubnet1
- !Ref DatabaseSubnet2
ElasticCacheSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
VpcId: !Ref Vpc
GroupDescription: Enable TCP connection on port 3306 for database connection
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '3306'
ToPort: '3306'
CidrIp: 0.0.0.0/0
ElasticCacheCluster:
Type: AWS::ElastiCache::CacheCluster
Properties:
AZMode: cross-az
CacheNodeType: cache.t2.small
Engine: memcached
NumCacheNodes: '3'
CacheSubnetGroupName: !Ref ElasticCacheSubnetGroup
VpcSecurityGroupIds:
- !Ref ElasticCacheSecurityGroup
PreferredAvailabilityZones:
- !Select
- 0
- Fn::GetAZs: !Ref AWS::Region
- !Select
- 1
- Fn::GetAZs: !Ref AWS::Region
이것은 내가 로그에서 얻은 오류입니다.
{
"StackId": "arn:aws:cloudformation:eu-west-1:733553390213:stack/threetierwebapp/c88ea6d0-d029-11ea-9279-02162fdbb6ee",
"EventId": "eed78640-d029-11ea-8cd8-02e056ab1688",
"ResourceStatus": "ROLLBACK_IN_PROGRESS",
"ResourceType": "AWS::CloudFormation::Stack",
"Timestamp": "2020-07-27T16:55:10.741Z",
"ResourceStatusReason": "The following resource(s) failed to create: [ElasticCacheCluster]. . Rollback requested by user.",
"StackName": "threetierwebapp",
"PhysicalResourceId": "arn:aws:cloudformation:eu-west-1:733553390213:stack/threetierwebapp/c88ea6d0-d029-11ea-9279-02162fdbb6ee",
"LogicalResourceId": "threetierwebapp"
},
{
"StackId": "arn:aws:cloudformation:eu-west-1:733553390213:stack/threetierwebapp/c88ea6d0-d029-11ea-9279-02162fdbb6ee",
"EventId": "ElasticCacheCluster-CREATE_FAILED-2020-07-27T16:55:09.946Z",
"ResourceStatus": "CREATE_FAILED",
"ResourceType": "AWS::ElastiCache::CacheCluster",
"Timestamp": "2020-07-27T16:55:09.946Z",
"ResourceStatusReason": "Cache Subnet Group threetierwebapp-elasticcachesubnetgroup-1hxvajmdjip1i does not exist. (Service: AmazonElastiCache; Status Code: 400; Error Code: CacheSubnetGroupNotFoundFault; Request ID: 790019b8-2ed8-4748-9c38-7c1eec121251)",
"StackName": "threetierwebapp",
"ResourceProperties": "{\"CacheNodeType\":\"cache.t2.small\",\"CacheSubnetGroupName\":\"threetierwebapp-elasticcachesubnetgroup-1hxvajmdjip1i\",\"VpcSecurityGroupIds\":[\"sg-0603c1f4b76c8afde\"],\"PreferredAvailabilityZones\":[\"eu-west-1a\",\"eu-west-1b\",\"eu-west-1c\"],\"NumCacheNodes\":\"3\",\"Engine\":\"memcached\",\"AZMode\":\"cross-az\"}",
"PhysicalResourceId": "",
"LogicalResourceId": "ElasticCacheCluster"
},
내 템플릿에 어떤 문제가 있으며 어떻게 수정할 수 있습니까?
당신은 할당 한 AWS::RDS::DBSubnetGroup
당신을위한 ElasticCacheSubnetGroup
자원.
대신 이것을 AWS :: ElastiCache :: SubnetGroup으로 바꾸고 여기 에서 DBSubnetGroupDescription
속성을 제거하십시오 .
이것은 아래와 같이 보일 것입니다
ElasticCacheSubnetGroup:
Type: AWS::ElastiCache::SubnetGroup
Properties:
SubnetIds:
- !Ref DatabaseSubnet1
- !Ref DatabaseSubnet2
ElasticCacheSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
VpcId: !Ref Vpc
GroupDescription: Enable TCP connection on port 3306 for database connection
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '3306'
ToPort: '3306'
CidrIp: 0.0.0.0/0
ElasticCacheCluster:
Type: AWS::ElastiCache::CacheCluster
Properties:
AZMode: cross-az
CacheNodeType: cache.t2.small
Engine: memcached
NumCacheNodes: '3'
CacheSubnetGroupName: !Ref ElasticCacheSubnetGroup
VpcSecurityGroupIds:
- !Ref ElasticCacheSecurityGroup
PreferredAvailabilityZones:
- !Select
- 0
- Fn::GetAZs: !Ref AWS::Region
- !Select
- 1
- Fn::GetAZs: !Ref AWS::Region
- !Select
- 2
- Fn::GetAZs: !Ref AWS::Region
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다