v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1466347371.7 KB

Adds permissions to the resource-based policy of a version of an Lambda layer. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all accounts in an organization, or all Amazon Web Services accounts.

To revoke permission, call RemoveLayerVersionPermission with the statement ID that you specified when you added it.

post/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy

Path parameters

LayerNamestring required

The name or Amazon Resource Name (ARN) of the layer.

VersionNumberinteger required

The version number.

Query parameters

RevisionIdstring

Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that has changed since you last read it.

Request body

StatementIdstring required

An identifier that distinguishes the policy from others on the same layer version.

Actionstring required

The API action that grants access to the layer. For example, <code>lambda:GetLayerVersion</code>.

Principalstring required

An account ID, or <code>*</code> to grant layer usage permission to all accounts in an organization, or all Amazon Web Services accounts (if <code>organizationId</code> is not specified). For the last case, make sure that you really do want all Amazon Web Services accounts to have usage permission to this layer.

OrganizationIdstring

With the principal set to <code>*</code>, grant permission to all accounts in the specified organization.

Response

Success

Statementstring

The permission statement.

RevisionIdstring

A unique identifier for the current revision of the policy.