It would be great to have two different stacks, one for the lambda layer version and one for the lambda function. Changes to lambda layer version in the other stack should automatically trigger an update to the function referencing it that is in another stack.
SSM Parameter is used as a workaround for this use case but when the lambda layer version is updated, the lambda function does not automatically update, it has to be updated manually to reflect the changes in the lambda layer version. Without the SSM parameter, the error Export [name] cannot be updated as it is in use by stack since we cannot update the exports and imports which are in use by other stack is returned.
Proposed Solution
No response
Other Information
No response
Acknowledgements
[ ] I may be able to implement this feature request
Thanks for the feature request. For more background here is the PR which introduced the changes in 2.27.0, which are referenced in the documentation that you linked.
Describe the feature
Currently, the @aws-cdk/aws-lambda:recognizeLayerVersion feature flag only works if the lambda layer version and lambda function are in same stack.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda-readme.html#currentversion-updated-hashing-logic-for-layer-versions
Use Case
It would be great to have two different stacks, one for the lambda layer version and one for the lambda function. Changes to lambda layer version in the other stack should automatically trigger an update to the function referencing it that is in another stack.
SSM Parameter is used as a workaround for this use case but when the lambda layer version is updated, the lambda function does not automatically update, it has to be updated manually to reflect the changes in the lambda layer version. Without the SSM parameter, the error
Export [name] cannot be updated as it is in use by stack since we cannot update the exports and imports which are in use by other stack
is returned.Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
2.118.0
Environment details (OS name and version, etc.)
MacOS, language=TypeScript