Skip to content

LambdaClient.add_layer_version_permission

rboto-lambda==0.4.0 · Service index · Types

Model summary (excerpt): 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.

Install and imports

python -m pip install "rboto[lambda]==0.4.0"
from rboto import LambdaClient
from rboto_lambda.types import (
    AddLayerVersionPermissionOutput,
)

Signature

async def add_layer_version_permission(
    *,
    layer_name: str,
    version_number: int,
    statement_id: str,
    action: str,
    principal: str,
    organization_id: str | None = None,
    revision_id: str | None = None,
) -> AddLayerVersionPermissionOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
layer_name Yes The name or Amazon Resource Name (ARN) of the layer.
version_number Yes The version number.
statement_id Yes An identifier that distinguishes the policy from others on the same layer version.
action Yes The API action that grants access to the layer. For example, lambda:GetLayerVersion .
principal 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.
organization_id No With the principal set to * , grant permission to all accounts in the specified organization.
revision_id 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.

Output

AddLayerVersionPermissionOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
statement str | None Always present —
revision_id str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

AddLayerVersionPermissionOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_lambda.exceptions:

InvalidParameterValueError, PolicyLengthExceededError, PreconditionFailedError, ResourceConflictError, ResourceNotFoundError, ServiceError, TooManyRequestsError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model