gpt4 book ai didi

java - 运行 Bitbucket 管道以部署到 AWS Cloudformation 时出错

转载 作者:行者123 更新时间:2023-12-03 07:38:44 25 4
gpt4 key购买 nike

我正在尝试使用该脚本部署到 AWS Cloud Formation。我正在使用 samconfig.toml 中存在的值。我可以在本地构建它,但在 bitbucket 管道中失败。

step:
name: Deploy to Cloudformation
script:
- pipe: atlassian/aws-sam-deploy:1.1.0
variables:
AWS_ACCESS_KEY_ID: 'my id here'
AWS_SECRET_ACCESS_KEY: 'key here'
AWS_SESSION_TOKEN: 'sessionToken'
AWS_DEFAULT_REGION: 'us-east-1'
S3_BUCKET: 's3bucketname'
STACK_NAME: 'stackname'
s3_prefix: 'stackname'
SAM_TEMPLATE: 'template.yaml'
capabilities: ['CAPABILITY_NAMED_IAM', 'CAPABILITY_AUTO_EXPAND']
parameter_overrides: ["VPC=\"vpcenteredhere\" VPCEName=\"vpceenteredhere\" MyStageName=\"test\" ApplicationTag=\"project\""]
✖ Failed to create the stack.
An error occurred (InsufficientCapabilitiesException) when calling the CreateStack operation: Requires capabilities : [CAPABILITY_AUTO_EXPAND]
ERROR: Failed to get information about stack stackname.
An error occurred (ValidationError) when calling the DescribeStacks operation: Stack with id stackname does not exist

最佳答案

您需要根据错误描述添加 [CAPABILITY_AUTO_EXPAND]

那就是,

step:
name: Deploy to Cloudformation
script:
- pipe: atlassian/aws-sam-deploy:1.1.0
variables:
AWS_ACCESS_KEY_ID: 'my id here'
AWS_SECRET_ACCESS_KEY: 'key here'
AWS_SESSION_TOKEN: 'sessionToken'
AWS_DEFAULT_REGION: 'us-east-1'
S3_BUCKET: 's3bucketname'
STACK_NAME: 'stackname'
s3_prefix: 'stackname'
SAM_TEMPLATE: 'template.yaml'
capabilities: ['CAPABILITY_NAMED_IAM','CAPABILITY_AUTO_EXPAND']
parameter_overrides: ["VPC=\"vpcenteredhere\" VPCEName=\"vpceenteredhere\" MyStageName=\"test\" ApplicationTag=\"project\""]

关于java - 运行 Bitbucket 管道以部署到 AWS Cloudformation 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75337664/

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