gpt4 book ai didi

amazon-web-services - 已删除 Cloudformation 堆栈,由于资源已存在,现在无法重新创建新的 Cloudformation 堆栈

转载 作者:行者123 更新时间:2023-12-05 04:02:22 30 4
gpt4 key购买 nike

我遇到了导致我的堆栈无法恢复的情况,我别无选择,只能将其删除。使用完全相同的模板,我继续创建了另一个同名的堆栈。

The following resource(s) failed to create: [AdminPanelCDNAccessIdentity, 
BackendLogGroup, BackendLoadBalancerSecurityGroup, AdminPanelCertificate,
EnvironmentCertificate, AdminPanelBucket, BackendECSTaskRole,
BackendECSTaskBitbucketAccess2RunTask, BackendLoadBalancerTargetGroup]. The
following resource(s) failed to update: [FrontEndBucket].

我真的需要手动删除所有这些资源并从头开始重建它们吗?这似乎是一个糟糕的选择。

这是我的模板代码的示例片段

Resources:
FrontEndBucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: !If
- IsProduction
- 'Fn::ImportValue': !Sub '${LandscapeStack}-DNSDomain'
- 'Fn::Sub':
- '${EnvironmentSubdomain}.${LandscapeDomain}'
- LandscapeDomain:
'Fn::ImportValue': !Sub '${LandscapeStack}-DNSDomain'
AccessControl: Private
Tags:
- Key: landscape
Value: !Ref Landscape
- Key: environment
Value: !Ref EnvironmentName
WebsiteConfiguration:
IndexDocument: index.html
Metadata:
'AWS::CloudFormation::Designer':
id: 53eb6c3a-767f-46fb-a719-2846f1fd6bdd
FrontEndBucketPolicy:
Type: 'AWS::S3::BucketPolicy'
Properties:
Bucket: !Ref FrontEndBucket
PolicyDocument:
Statement:
- Effect: Allow
Action:
- 's3:PutObject'
- 's3:GetObject'
- 's3:DeleteObject'
Resource: !Sub 'arn:aws:s3:::${FrontEndBucket}/*'
Principal:
AWS:
'Fn::ImportValue': !Sub '${CIResourcesStack}-BitbucketFrontEndPipelineUser'
- Effect: Allow
Action:
- 's3:ListBucket'
Resource: !Sub 'arn:aws:s3:::${FrontEndBucket}'
Principal:
AWS:
'Fn::ImportValue': !Sub '${CIResourcesStack}-BitbucketFrontEndPipelineUser'
- Effect: Allow
Action:
- 's3:GetObject'
Resource: !Sub 'arn:aws:s3:::${FrontEndBucket}/*'
Principal:
CanonicalUser: !GetAtt FrontEndCDNAccessIdentity.S3CanonicalUserId
Metadata:
'AWS::CloudFormation::Designer':
id: f8d2a536-790c-4cbe-adcb-b50754c0922e

对此的任何帮助将不胜感激!!

最佳答案

您可能选择保留删除堆栈时未能删除的所有资源。 CloudFormation 不会将现有资源纳入堆栈。您需要手动删除旧堆栈创建的所有资源,然后才能部署此完全相同的堆栈。或者,您可以在再次部署之前更改资源的名称。

关于amazon-web-services - 已删除 Cloudformation 堆栈,由于资源已存在,现在无法重新创建新的 Cloudformation 堆栈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54393950/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com