Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with cross-account lambda layers #31

Open
yzAlvin opened this issue Jul 15, 2022 · 0 comments
Open

Not working with cross-account lambda layers #31

yzAlvin opened this issue Jul 15, 2022 · 0 comments

Comments

@yzAlvin
Copy link

yzAlvin commented Jul 15, 2022

hello, maybe aws changed something, but for me this is not working for cross-account lambda layers

This is the error I get when trying to deploy my serverless stack

arn:aws:sts::xxxxxxx:assumed-role/zzzzzzz/zzzzzzz is not authorized to perform: lambda:ListLayerVersions on resource: arn:aws:lambda:ap-southeast-2:yyyyyyyy:layer:layer-name because no resource-based policy allows the lambda:ListLayerVersions action

To try and fix the above error I have tried:

aws lambda add-layer-version-permission \
              --layer-name arn:aws:lambda:ap-southeast-2:yyyyyyyy:layer:layer-name \
              --statement-id ListVersions \
              --action lambda:ListLayerVersions  \
              --principal xxxxxxx \
              --version-number 1

we get this error: An error occurred (ValidationException) when calling the AddLayerVersionPermission operation: 1 validation error detected: Value 'ListLayerVersions' at 'action' failed to satisfy constraint: Member must satisfy regular expression pattern: lambda:GetLayerVersion, so not sure how we can fix that error with lambda:ListLayerVersions if we are only allowed to add lambda:GetLayerVersion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant