Skip to content

How to get the latest version of a lambda layer? #26670

Answered by peterwoodworth
timandy asked this question in Q&A
Discussion options

You must be logged in to vote

Answer: CDK won't look anything up in your AWS account regarding your Lambda Layer - so if you need a specific version of that layer, you will have to include that version in the arn that you pass in when importing.
If you need to programatically fetch the version of your arn, follow the following advice from our best practices page, see Commit cdk.context.json on this page for more information

If you need some value (from AWS or elsewhere) for which there is no native CDK context provider, we recommend writing a separate script. The script should retrieve the value and write it to a file, then read that file in your CDK app. Run the script only when you want to refresh the stored value, …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@github-actions
Comment options

@dil-anovosz
Comment options

@jjrdevspace01
Comment options

@gavihs
Comment options

Answer selected by github-actions
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants