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

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.

Servers

Path parameters

Name Type Required Description
LayerName String Yes

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

VersionNumber Integer Yes

The version number.

Request headers

Name Type Required Description
X-Amz-Content-Sha256 String No
X-Amz-Credential String No
Content-Type String Yes The media type of the request body.

Default value: "application/json"

X-Amz-Date String No
X-Amz-Algorithm String No
X-Amz-SignedHeaders String No
X-Amz-Security-Token String No
X-Amz-Signature String No

Query parameters

Name Type Required Description
RevisionId String No

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 fields

Name Type Required Description
StatementId String Yes

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

Principal String Yes

An account ID, or * to grant layer usage permission to all accounts in an organization, or all Amazon Web Services accounts (if organizationId 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.

OrganizationId String No

With the principal set to *, grant permission to all accounts in the specified organization.

Action String Yes

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

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.