1 Answer
- Newest
- Most votes
- Most comments
0
The ARN for a Lambda layers is constructed as follows. Using this information you can construct the right ARN to put into things like CloudFormation and CDK.
arn:PARTITION:REGION:ACCOUNT:layer:LAMBDA-LAYER-NAME:VERSION
- If you're operating in the AWS commercial regions (which is everything except our China regions and GovCloud) then
REGIONwill be "aws". REGIONis the region name that the Lambda Layer is deployed in.ACCOUNTis the account number that you're operating in.LAMBDA_LAYER_NAMEis the name of the layer.VERSIONis the version that you want to reference.
You can find more information about how ARNs are constructed here: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html
You can also call the Lambda service using the ListLayers API to look for the current version of the Lambda Layer.
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 3 years ago

unfortunately, that did not work.
aws provided lambda layers is different in different region and it's different from logged-in account.
if we want to create a lambda and add a layer using terraform or cloudformation without knowing the layer ARN beforehand, how to do that?
I can pass the lambda layer name and version. also below commands is giving an empty list
Output
At this time, there isn't an API to get a list of AWS-curated Lambda Layers.