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.

Custom::CDKBucketDeployment failed to create

See original GitHub issue
  • I’m submitting a …

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior? If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce

I’m using a Custom::CDKBucketDeployment resource to deploy a static website to a S3 bucket:

// A CDK helper that takes the defined source directory, compresses it, and uploads it to the destination s3 bucket.
    new s3deploy.BucketDeployment(this, "DeployWebsite", {
      source: s3deploy.Source.asset(webAppRoot),
      destinationKeyPrefix: "web/",
      destinationBucket: bucket,
      retainOnDelete: false
    });

When running the cdk deploy command this fails with:

9/10 | 3:50:56 PM | CREATE_FAILED        | Custom::CDKBucketDeployment                     | DeployWebsite/CustomResource/Default (DeployWebsiteCustomResourceD116527B) Failed to create resource. Command '['python3', '/var/task/aws', 's3', 'cp', 's3://cdktoolkit-stagingbucket-198n7ki0ng3ti/assets/MythicalMysfitsWebsiteDeployWebsiteAsset1A926195/2299535aebe61fbe992dffa2c950144f29f963029c9a5b7758b93409fd4e379a.zip', '/tmp/tmpfxnjcuck/archive.zip']' returned non-zero exit status 1.
        new CustomResource (/home/ec2-user/environment/workshop/cdk/node_modules/@aws-cdk/aws-cloudformation/lib/custom-resource.ts:92:21)
        \_ new BucketDeployment (/home/ec2-user/environment/workshop/cdk/node_modules/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts:89:5)
        \_ new WebApplicationStack (/home/ec2-user/environment/workshop/cdk/lib/web-application-stack.ts:50:5)
        \_ Object.<anonymous> (/home/ec2-user/environment/workshop/cdk/bin/cdk.ts:7:1)
        \_ Module._compile (internal/modules/cjs/loader.js:776:30)
        \_ Module.m._compile (/home/ec2-user/environment/workshop/cdk/node_modules/ts-node/src/index.ts:473:23)
        \_ Module._extensions..js (internal/modules/cjs/loader.js:787:10)
        \_ Object.require.extensions.(anonymous function) [as .ts] (/home/ec2-user/environment/workshop/cdk/node_modules/ts-node/src/index.ts:476:12)
        \_ Module.load (internal/modules/cjs/loader.js:653:32)
        \_ tryModuleLoad (internal/modules/cjs/loader.js:593:12)
        \_ Function.Module._load (internal/modules/cjs/loader.js:585:3)
        \_ Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
        \_ Object.<anonymous> (/home/ec2-user/environment/workshop/cdk/node_modules/ts-node/src/bin.ts:158:12)
        \_ Module._compile (internal/modules/cjs/loader.js:776:30)
        \_ Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
        \_ Module.load (internal/modules/cjs/loader.js:653:32)
        \_ tryModuleLoad (internal/modules/cjs/loader.js:593:12)
        \_ Function.Module._load (internal/modules/cjs/loader.js:585:3)
        \_ Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
        \_ findNodeScript.then.existing (/home/ec2-user/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/libnpx/index.js:268:14)
  • What is the expected behavior (or behavior of feature suggested)? Expected behavior is that the static website content is deployed onto the S3 bucket.

  • What is the motivation / use case for changing the behavior or adding this feature? N/A

  • Please tell us about your environment:

    • CDK CLI Version: 1.4.0
    • Module Version: 1.4.0
    • OS: all
    • Language: TypeScript (but I expect all to be affected)
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
hoegertncommented, Aug 15, 2019

@eladb any plans for a v1.4.1 with this fix?

3reactions
eladbcommented, Aug 15, 2019

Confirming this is a bug, we have a repro.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop Using the CDK S3 Deployment Module
The BucketDeployment construct synthesizes a custom CloudFormation resource of type Custom::CDKBucketDeployment into the template.
Read more >
class BucketDeployment (construct) · AWS CDK
If this is set to false, files in the destination bucket that do not exist in the asset, will NOT be deleted during...
Read more >
AWS CDK BucketDeployment — should you use it - Medium
AWS CDK BucketDeployment — should you use it ? ... “In progress” and eventually having the custom resource timing out and failing the...
Read more >
CDK deploy Gatsby site exceeds 50 routing rules
Is CREATE FAILED died with <Signals.SIGKILL: 9>. the actual error message? – gshpychka. Jan 4 at 15:48.
Read more >
Use a bucket deployment to upload a file to S3 ... - Egghead.io
15. Use a bucket deployment to upload a file to S3 when deploying a CDK stack. 1m 32s. 16. Create a custom AWS...
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