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

User is not authorized to perform: lambda:GetLayerVersion #3624

Closed
mfrangakis opened this issue Jan 16, 2024 · 3 comments
Closed

User is not authorized to perform: lambda:GetLayerVersion #3624

mfrangakis opened this issue Jan 16, 2024 · 3 comments

Comments

@mfrangakis
Copy link

As posted on Discord , I am getting an error while trying to deploy to the af-south-1 region.

clarity/ServerFunction/ServerFunction: Resource handler returned message: "User: arn:aws:sts::<acc_id>:assumed-role/cdk-hnb659fds-cfn-exec-role-857082827836-af-south-1/AWSCloudFormation is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:af-south-1:226609089145:layer:sst-extension-arm64:2 because no resource-based policy allows the lambda:GetLayerVersion action (Service: Lambda, Status Code: 403, Request ID: <req_id>)" (RequestToken: <req_id>, HandlerErrorCode: AccessDenied)

I have attempted the same in eu-west-1 without issue. Appears to be that the Lambda Layer managed by the SST team may not have a resource policy that allows other accounts to access it. See this issue on another project where the same issue was resolved.

If I create a lambda function from the console and attempt to add the above layer ARN, I get the same error:
image

In eu-west-1 though, this is not a problem.
image

@jayair
Copy link
Contributor

jayair commented Jan 17, 2024

Oh on Discord I missed that this is about the SST Lambda Layer.

Looking into it.

@mfrangakis
Copy link
Author

After upgrading to SST version 2.39.6, running the deploy command appears not to utilize the SST Lambda layer any longer. The ServerFunction has no layers any more. Hence, deployment to af-south-1 now works without issue.

@fwang
Copy link
Contributor

fwang commented Jan 26, 2024

Hi @mfrangakis, this should be fixed now.

^ to add some context, af-south-1 along w/ a few other regions were not enabled by AWS by default. And the layers were not published to them.

All regions should now have the layers.

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

3 participants