Skip to content

add_layer_version_permission

Operation

add_layer_version_permission

add_layer_version_permission(request: AddLayerVersionPermissionInput | AddLayerVersionPermissionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[AddLayerVersionPermissionInputDict]) -> AddLayerVersionPermissionOutput

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.

Parameters:

Name Type Description Default
request AddLayerVersionPermissionInput | AddLayerVersionPermissionInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[AddLayerVersionPermissionInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
AddLayerVersionPermissionOutput

An instance of AddLayerVersionPermissionOutput.

add_layer_version_permission async

add_layer_version_permission(request: AddLayerVersionPermissionInput | AddLayerVersionPermissionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[AddLayerVersionPermissionInputDict]) -> AddLayerVersionPermissionOutput

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.

Parameters:

Name Type Description Default
request AddLayerVersionPermissionInput | AddLayerVersionPermissionInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[AddLayerVersionPermissionInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
AddLayerVersionPermissionOutput

An instance of AddLayerVersionPermissionOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

AddLayerVersionPermissionInputDict

Bases: TypedDict

Dictionary form of AddLayerVersionPermissionInput.

Attributes

action instance-attribute
action: Required[str]

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

layer_name instance-attribute
layer_name: Required[str]

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

organization_id instance-attribute
organization_id: str | None

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

principal instance-attribute
principal: Required[str]

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.

revision_id instance-attribute
revision_id: str | None

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.

statement_id instance-attribute
statement_id: Required[str]

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

version_number instance-attribute
version_number: int | None

The version number.

AddLayerVersionPermissionInput dataclass

Bases: _SerdeShape

Dataclass for AddLayerVersionPermissionInput structure.

Attributes

action class-attribute instance-attribute
action: str | None = ...

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

layer_name class-attribute instance-attribute
layer_name: str | None = ...

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

organization_id class-attribute instance-attribute
organization_id: str | None = ...

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

principal class-attribute instance-attribute
principal: str | None = ...

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.

revision_id class-attribute instance-attribute
revision_id: str | None = ...

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.

statement_id class-attribute instance-attribute
statement_id: str | None = ...

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

version_number class-attribute instance-attribute
version_number: int | None = ...

The version number.

Output

AddLayerVersionPermissionOutput dataclass

Bases: _SerdeShape

Dataclass for AddLayerVersionPermissionOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

revision_id class-attribute instance-attribute
revision_id: str | None = ...

A unique identifier for the current revision of the policy.

statement class-attribute instance-attribute
statement: str | None = ...

The permission statement.