antonpaquin / Tensorflow-Lambda-Layer

Lets you import Tensorflow + Keras from an AWS lambda
MIT License
86 stars 11 forks source link

Add ability to download Layer archives #11

Closed ciaransweet closed 4 years ago

ciaransweet commented 4 years ago

Hi there,

We're using arn:aws:lambda:us-east-2:347034527139:layer:tf_1_1_keras:1 inside our Lambdas and would love to be able to use it locally with LocalStack to test our functions in our CI environments.

Is there a possibility of being able to 'easily' get the archives for the layers?

I found:

# https://docs.aws.amazon.com/cli/latest/reference/lambda/get-layer-version-by-arn.html
URL=$(aws lambda get-layer-version-by-arn --arn arn:aws:lambda:us-east-1:209497400698:layer:php-73:7 --query Content.Location --output text)
curl $URL -o php.zip

On Stack Overflow

But I get:

An error occurred (AccessDeniedException) when calling the GetLayerVersionByArn operation: User: arn:aws:iam::<big-number>:user/evansc is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:us-east-2:347034527139:layer:tf_1_1_keras:1
ciaransweet commented 4 years ago

I'm being silly. Wrong regions. Doh.