LambdaClient.add_permission
rboto-lambda==0.4.0 · Service index · Types
Model summary (excerpt): Grants a principal permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function. Note: Lambda does not support adding policies to version $LATEST. To grant permission to another...
Install and imports
from rboto import LambdaClient
from rboto_lambda.types import (
AddPermissionOutput,
FunctionUrlAuthType,
)
Signature
async def add_permission(
*,
function_name: str,
statement_id: str,
action: str,
principal: str,
source_arn: str | None = None,
function_url_auth_type: FunctionUrlAuthType | None = None,
invoked_via_function_url: bool | None = None,
source_account: str | None = None,
event_source_token: str | None = None,
qualifier: str | None = None,
revision_id: str | None = None,
principal_org_id: str | None = None,
) -> AddPermissionOutput: ...
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) |
|---|---|---|
function_name |
Yes | The name or ARN of the Lambda function, version, or alias. Name formats Function name – my-function (name-only), my-function:v1 (with alias). Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function . Partial ARN – 123456789012:function:my-function . You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you... |
statement_id |
Yes | A statement identifier that differentiates the statement from others in the same policy. |
action |
Yes | The action that the principal can use on the function. For example, lambda:InvokeFunction or lambda:GetFunction . |
principal |
Yes | The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use SourceArn or SourceAccount to limit who can invoke the function through that service. |
source_arn |
No | For Amazon Web Services services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic. Note that Lambda configures the comparison using the StringLike operator. |
function_url_auth_type |
No | The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Control access to Lambda function URLs . |
invoked_via_function_url |
No | Indicates whether the permission applies when the function is invoked through a function URL. |
source_account |
No | For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with SourceArn to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account. |
event_source_token |
No | For Alexa Smart Home functions, a token that the invoker must supply. |
qualifier |
No | Specify a version or alias to add permissions to a published version of the function. |
revision_id |
No | Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it. |
principal_org_id |
No | The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization. |
Output
AddPermissionOutput.
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 | — |
| 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.
Related types
AddPermissionOutput, FunctionUrlAuthType
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, PublicPolicyError, ResourceConflictError, ResourceNotFoundError, ServiceError, TooManyRequestsError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.