question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-cdk/aws-s3-deployment): Directory deployment doesn't work

See original GitHub issue

Hello,

It looks like that BucketDeployment doesn’t work for directories. I have an non-empty directory with some files which i want to deploy. When I deploy, i receive an error Uploaded file must be a non-empty zip. However the documentation states that source of the BucketDeployment can be a directory.

Reproduction Steps

Create a resource similar to this one:

        s3_deployment.BucketDeployment(
            self,
            "MyResource",
            sources=[s3_deployment.Source.asset("./mydir")],
            destination_bucket=workspace_bucket,
            destination_key_prefix="/mydir",
            vpc=vpc,
            vpc_subnets=ec2.SubnetSelection(subnets=vpc.private_subnets)
        )

where mydir is a non empty directory.

What did you expect to happen?

mydir folder is synced with with destination folder.

What actually happened?

I receive an error Uploaded file must be a non-empty zip

Environment

  • CDK CLI Version : 1.95.1
  • Framework Version: 1.95.1
  • Node.js Version: v15.12.0
  • OS : Mac OS 11.1
  • Language (Version): Python 3.9.2

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pavelhlushchankacommented, Mar 30, 2021

@iliapolo Thanks for the tip. I have cleaned up the bootstrap bucket and it works now. I’m closing the issue.

0reactions
github-actions[bot]commented, Mar 30, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting common AWS CDK issues
When deploying my AWS CDK stack, I receive a NoSuchBucket error. Your AWS environment has not been bootstrapped, and so does not have...
Read more >
aws-cdk/aws-s3-deployment module - AWS Documentation
IMPORTANT The aws-s3-deployment module is only intended to be used with zip files from trusted sources. Directories bundled by the CDK CLI (by...
Read more >
Troubleshooting common AWS CDK issues
This topic describes how to troubleshoot the following issues with the AWS CDK.
Read more >
aws-cdk/aws-s3-assets module - AWS Documentation
When deploying a CDK app that includes constructs with assets, the CDK toolkit will first upload all the assets to S3, and only...
Read more >
Your first AWS CDK app - AWS Documentation
Create the app · Build the app · List the stacks in the app · Add an Amazon S3 bucket · Synthesize an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found