![](/img/trans.png)
[英]aws cloudformation snippet for S3 Bucket to apply LifecycleConfiguration to delete all existing versions
[英]AWS Cloudformation Codecommit S3 400 Exception
我已经创建了一个 cloudformation 模板,它在 codecommit 中创建了一个新的 repo,它还需要从 S3 中提取 source.zip 并将其复制到 repo。 但是在运行模板时我看到 400 个错误请求。
CF模板:
AWSTemplateFormatVersion: 2010-09-09
Description: my First code commit CF template
Parameters:
DemoBucket:
Type: String
Description: Bucket in which you have code
Default: jaivijaycccf
DemoKey:
Type: String
Description: key of zipped code
Default: demo.zip
Resources:
HelloWorld:
Type: AWS::CodeCommit::Repository
Properties:
RepositoryName: HelloWorldApp
RepositoryDescription: This is a repository for my project with code from MySourceCodeBucket
Code:
BranchName: development
S3:
Bucket: !Ref DemoBucket
Key: !Ref DemoKey
ObjectVersion: 1
如果存储源代码的 S3 存储桶不使用 Object 版本控制,则向 Cloudformation 模板提供 ObjectVersion 参数将导致它失败。
删除不必要的参数将解决问题。
在您确认您没有使用 object 版本控制后,我将此添加为答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.