(aws-s3-deployment): BucketDeployment fails for new bucket in same stack
See original GitHub issuebucket = aws_s3.Bucket(
self,
id=domain,
bucket_name=domain,
website_index_document="hello_world.html",
public_read_access=True
)
aws_s3_deployment.BucketDeployment(
self,
id="{}-bucket-deployment".format(domain),
destination_bucket=bucket,
sources=[aws_s3_deployment.Source.asset("./static")] # static file directory
)
Running the above in the same stack creates the bucket but fails during creation of the bucket deployment with
CREATE_FAILED | Custom::CDKBucketDeployment | <domain>...omResource/Default
Failed to create resource. Command '['/opt/awscli/aws', 's3', 'sync', '--delete', '/tmp/tmpvnmebqim/contents', 's3://<bucket-name>/']' returned non-zero exit status 1.
What did you expect to happen?
CDK deployment to succeed to upload static files to the newly created s3 bucket
Environment
- CDK CLI Version: 1.91.0
- Framework Version: 1.91.0
- Node.js Version: v15.4.0
- OS : mac OS 10.15.6
- Language (Version): Python 3.8.6
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
Top Results From Across the Web
aws-cdk/aws-s3-deployment module - AWS Documentation
When the BucketDeployment is removed from the stack, the contents are retained in the destination bucket (#952). If you are using s3deploy.Source.bucket() to ......
Read more >How to use the @aws-cdk/aws-s3-deployment ... - Snyk
BucketDeployment function in @aws-cdk/aws-s3-deployment ... Construct, id: string, props: {}) { const stack = new cdk.Stack(scope, id, props); // TODO: ...
Read more >When I add this BucketDeployment to my CDK CodePipeline ...
According to the BucketDeployment docs the assets are uploaded to an intermediary bucket and then later merged to your bucket. This matters ...
Read more >AWS CDK v2 Tutorial – How to Create a Three-Tier Serverless ...
This familiar pattern is fertile ground for learning new technologies ... import { RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib'; ...
Read more >cdk-s3bucket-ng - npm
But We forget delete Object in S3 Bucket first , so destroy will fail. ... and the usage is almost the same as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I see my problem, I changed the KMS key on my bucket, that would probably explain what has happened.
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.