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.

"cdk diff" should take assets into account

See original GitHub issue

When running cdk diff, the toolkit should take assets into account. At the moment, if only assets change, “cdk diff” will show no differences, but “cdk deploy” will update the stack since the asset’s md5 changes.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:26
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
brad-jonescommented, Mar 20, 2019

For a quick and dirty hack I just inject a hash of the asset into the stack somewhere, in the case of a lambda just set an environment variable. Then when running cdk diff it’s obvious what will update.

new lambda.Function(this, 'SomeLambda', {
	code: lambda.Code.asset('/path/to/zip'),
	environment: {
		HASH: HashFuncOfYourChoice('/path/to/zip'),
	},
	etc...
});
0reactions
eladbcommented, Oct 2, 2019

will be fixed by #2821

Read more comments on GitHub >

github_iconTop Results From Across the Web

DefaultStackSynthesizerProps - AWS Documentation
The role to use to publish file assets to the S3 bucket in this environment. You must supply this if you have given...
Read more >
AWS CDK Toolkit - npm
cdk diff, Diff stacks against current state. cdk deploy, Deploy a stack into an AWS account. cdk destroy, Deletes a stack from an...
Read more >
Deploying your CDK app to different stages and environments
This property receives the account id and the region for this stack. If you do not want to configure the real target data...
Read more >
Hey CDK, how do cross-account deployments work?
As soon as you start using assets in your CDK application, you need to bootstrap your AWS account. Assets could be files or...
Read more >
Lessons in AWS Python CDK: 1-Getting Started
If you are using Homebrew for everything else, you might as well use it to install the CDK as well. You can also...
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