-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"cdk diff" should take assets into account #395
Comments
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 new lambda.Function(this, 'SomeLambda', {
code: lambda.Code.asset('/path/to/zip'),
environment: {
HASH: HashFuncOfYourChoice('/path/to/zip'),
},
etc...
}); |
Copy @sam-goodwin |
Having the same issue, but as I'm not referencing a zip file but a directory, I cannot use @brad-jones workaround. The zip md5 could be made available so that I can put its value an an output value (supposing that different output values buiolt with |
Wonder if this could be achieved by using a checksum? That would have the benefit of #395 (comment) 's comment without having to zip beforehand. Since the |
will be fixed by #2821 |
The `NestedStack` construct is a special kind of `Stack`. Any resource defined within its scope will be included in a separate template from the parent stack. The template for the nested stack is synthesized into the cloud assembly but not treated as a deployable unit but rather as a file asset. This will cause the CLI to upload it to S3 and wire it's coordinates to the parent stack so we can reference its S3 URL. To support references between the parent stack and the nested stack, we abstracted the concept of preparing cross references by inverting the control of `consumeReference` from the reference object itself to the `Stack` object. This allows us to override it at the `NestedStack` level (through `prepareCrossReference`) and mutate the token accordingly. When an outside resource is referenced within the nested stack, it is wired through a synthesized CloudFormation parameter. When a resource inside the nested stack is referenced from outside, it will be wired through a synthesized CloudFormation output. This works for arbitrarily deep nesting. When an asset is referenced within a nested stack, it will be added to the top-level stack and wired through the asset parameter reference (like any other reference). Fixes #239 Fixes #395 Related #3437 Related #1439 Related #3463
Since source hash is now used to identify assets, if an asset changes, the diff will show it (yey!). Resolves #395
Since source hash is now used to identify assets, if an asset changes, the diff will show it (yey!). Resolves #395
Since source hash is now used to identify assets, if an asset changes, the diff will show it (yey!). Resolves #395
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.The text was updated successfully, but these errors were encountered: