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.

assets: EKS not deployable via CDK Pipelines

See original GitHub issue

Hi there!

I am trying to deploy an EKS cluster via CDK Pipelines. This breaks, because the assets for custom resources within EKS are referenced with absolute path in ...assets.json. This happens during cdk synth in the Pipelines build step. Then, in a later pipeline step, cdk-assets is not able to find the assets (because CodeBuild generate random temp dir names for each run) and therefor uploads empty zip files to S3. This breaks the deployment of the application stack (eks) with this error message in CloudFormation:

Uploaded file must be a non-empty zip (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 6443c97c-4806-4f82-8224-5a4e2afc48b2; Proxy: null)

Reproduction Steps

  1. Create a CDK Pipeline according to the dev guide
  2. add an EKS stack application stage via pipeline.addApplicationStage()
  3. deploy the pipeline and wait for it to fail during application stack deployment

What did you expect to happen?

cdk synth should create references with relative paths for the assets.

What actually happened?

cdk synth creates references with absolute paths for the assets.

Environment

  • CDK CLI Version: 1.75
  • Framework Version: 1.75
  • Node.js Version: v12.18.0
  • OS : Ubuntu 18.10
  • Language (Version): TypeScript (3.9.7)

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
rix0rrrcommented, Dec 1, 2020

@bracki you are gold.

1reaction
brackicommented, Nov 30, 2020

This seems like a bug in https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts#L143. If I replace that line with fileName: staging.relativeStagedPath(stack) it works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Continuous Delivery of Amazon EKS Clusters Using AWS ...
This post shows the use of AWS CDK and CDK Pipelines to deploy Amazon EKS clusters. Overview. In this post, we will show...
Read more >
Managing an Amazon EKS Cluster Using AWS CDK ... - Noise
This blog demonstrates how to spin up cluster infrastructure managed by CI/CD using CDK code and Cloud Resource Property Manager (CRPM) ...
Read more >
Deploy to AWS from GitLab CI/CD
GitLab provides Docker images with the libraries and tools you need to deploy to AWS. You can reference these images in your CI/CD...
Read more >
StackDeployment | @aws-quickstart/eks-blueprints
Deployment of a single Stack ... Hierarchy. StackDeployment. Defined in node_modules/aws-cdk-lib/pipelines/lib/blueprint/stack-deployment.d.ts:75 ...
Read more >
How to switch and do cdk deploy to a different account?
❌ Building assets failed: Error: Building Assets Failed: Error: Could not assume role in target account using current credentials (which are ...
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