Get ARN of vendored layers

Viewed 203

Looks like AWS layers like AWSLambda-Python37-SciPy1x have a different account and head version in the ARN in different regions. Eg

  • us-east-1: arn:aws:lambda:us-east-1:668099181075:layer:AWSLambda-Python37-SciPy1x:22
  • us-east-2: arn:aws:lambda:us-east-2:259788987135:layer:AWSLambda-Python37-SciPy1x:20

From a script I need to add the layer that pertains to the lambda's region, but I'm not finding an AWS CLI or boto3 command that will give me the ARN of a "published" layer (ie one that was given access to by an AWS admin to all accounts), I can only find my own layers (eg aws lambda list-layers).

The AWS console for lambda in web browser shows the vendored layers, so I loaded the page and looked through js console and saw the following request is made:

https://console.aws.amazon.com/lambda/services/ajax?operation=listAwsVendedLayers&locale=en

So it looks like the REST API has this operation to get that, but I cannot find the equivalent anywhere in AWS CLI or boto3.

Any ideas (short of using curl with the proper request head and auth info, pain), perhaps a way to run a "raw" request in boto3 so I could give it this listAwsVendedLayers operation? I looked in the docs could not find anything.

0 Answers
Related