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
- I wonder what was the reasoning for current approach and should it be changed?
- 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:
- Created 4 years ago
- Reactions:19
- Comments:11 (5 by maintainers)
Top 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 >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
Any update on this?
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 withlambda.Code.fromAsset('/path/that/does-not/exist')
fails with the messageCannot find asset at /path/that/does-not/exist
.I’ve put a minimal reproduction together at https://github.com/dansalias/tmp-cdk-6743