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.

Deploying stack all other stack assets must be present

See original GitHub issue

❓ General Issue

I have multiple stacks in my project and want I deploy only one of them all other stack assets must be present in file tree or else I get ENOENT: no such file or directory, stat....

I did a little digging and figured: a. cdk cli spawns process ts-node /bin/script.ts b. cdk cli does not pass stack name to aws-cdk, therefore I cannot know which should be synthesized c. aws-cdk generates all cloudformation jsons for all stacks it can find and cdk cli picks the ones it needs

I think it would be smart to provide the name of stack and generate only provided one, it would be faster and would not require all assets to be present.

PS. With aws-cli I’m referening to aws-cdk installed globally and with aws-cdk I refer to project dependency.

The Question

  1. I wonder what was the reasoning for current approach and should it be changed?
  2. Maybe I’m missing something and this can be easily resolved?

Environment

  • **CDK CLI Version: 1.27.0 (build a98c0b3)
  • **Module Version: “@aws-cdk/core”: “^1.27.0”
  • **OS: MacOs Mojave
  • **Language: Typescript

Other information

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:19
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
diesal11commented, May 18, 2022

Any update on this?

2reactions
dansaliascommented, Jul 6, 2021

I am encountering the same issue.

Synthesising or attempting to deploy a stack with the --exclusively flag when another stack in the app references a nonexistent path with lambda.Code.fromAsset('/path/that/does-not/exist') fails with the message Cannot find asset at /path/that/does-not/exist.

I’ve put a minimal reproduction together at https://github.com/dansalias/tmp-cdk-6743

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create an app with multiple stacks - AWS Documentation
Stacks are the unit of deployment: each stack in an app can be synthesized and deployed individually using the cdk deploy command.
Read more >
aws-cdk-lib - npm
A Stack is the smallest physical unit of deployment, and maps directly onto a CloudFormation Stack. You define a Stack by defining a...
Read more >
How to upload assets when creating a CloudFormation stack ...
What would be taken care of for me by the AWS CLI in a normal situation would be that cdk deploy would first...
Read more >
Hey CDK, how do cross-account deployments work?
Just provide a stack name or --all and it will synthesize the application, publish the assets (to S3 and ECR), and deploy the...
Read more >
cdk deploy - AWS CDK Workshop
The first time you deploy an AWS CDK app into an environment (account/region), you can install a “bootstrap stack”. This stack includes resources...
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