Skip to content

How to add/remove lambda layer version permissions on AWS console

0

The lambda API reference has the AddLayerVersionPermission & RemoveLayerVersionPermission actions but I am unable to find a similar way to add/remove permissions to/from lambda layers on the console.

This is all I can see when I am creating lambda layers:

Enter image description here

Is this expected?

asked 8 months ago222 views
1 Answer
0

Based on the information available, it appears that adding or removing Lambda layer version permissions is primarily done through the AWS CLI or API rather than directly through the AWS Console.

To add permissions to a Lambda layer version using the AWS CLI, you would use the add-layer-version-permission command. For example:

aws lambda add-layer-version-permission \
--layer-name my-layer \
--version-number 1 \
--statement-id xaccount \
--action lambda:GetLayerVersion \
--principal 123456789012 \
--output text

This grants the specified AWS account (123456789012) permission to use version 1 of your layer.

To revoke these permissions, you would use the remove-layer-version-permission command with the statement ID that you specified when you added the permission.

The AWS Console interface you've shown in your screenshot is for creating and configuring the layer itself, but doesn't include the cross-account permission management features. This is expected behavior, as these more advanced permission controls are currently available through the CLI and API interfaces rather than the console.

Remember that permissions apply only to a single layer version, so you'll need to repeat the process each time you create a new layer version.
Sources
Granting Lambda layer access to other accounts - AWS Lambda
Lambda examples using AWS CLI - AWS SDK Code Examples
AddLayerVersionPermission - AWS Lambda

answered 8 months ago
EXPERT
reviewed 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.