Skip to content

AWS::Lambda::Permission

The AWS::Lambda::Permission resource grants an AWS service or another account permission to use a function.

Generated by cfn-typegen --out cfn_types AWS::Lambda::Permission into cfn_types/lambda_.py:

# Generated by cfn-typegen from the CloudFormation registry schemas. Do not edit.
# fmt: off
# ruff: noqa
"""AWS::Lambda resources."""

from typing import Any, Literal, NotRequired, Unpack
from typing_extensions import TypedDict
from cfn_typed.base import DeletionPolicy, DependsOn, ResourceAttrs, UpdateReplacePolicy, build
from cfn_typed.intrinsics import Expr


CONSTRAINTS:dict[str,Any]={
'AWS::Lambda::Permission':{'Id':{'p':"^.*$",'l':1,'L':256},'Action':{'p':"^(lambda:[*]|lambda:[a-zA-Z]+|[*])$",'l':1,'L':256},'EventSourceToken':{'p':"^[a-zA-Z0-9._\\-]+$",'l':1,'L':256},'FunctionName':{'p':"^(arn:(aws[a-zA-Z-]*)?:lambda:)?((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST(\\.PUBLISHED)?|[a-zA-Z0-9-_]+))?$",'l':1,'L':140},'FunctionUrlAuthType':{'e':["AWS_IAM","NONE"]},'Principal':{'p':"^.*$",'l':1,'L':256},'PrincipalOrgID':{'p':"^o-[a-z0-9]{10,32}$",'l':12,'L':34},'SourceAccount':{'p':"^\\d{12}$",'l':12,'L':12},'SourceArn':{'p':"^arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)$",'l':12,'L':1024}},
}


ATTRIBUTES:dict[str,Any]={"AWS::Lambda::Permission":["FunctionName","Id"]}


RULES:dict[str,Any]={}
Nested types (3)

These are defined above the properties in the generated module.

class PermissionProps(TypedDict, closed=True):
    'The ``AWS::Lambda::Permission`` resource grants an AWS service or another account permission to use a function.'
    Action: Expr[str]
    'The action that the principal can use on the function.'
    EventSourceToken: NotRequired[Expr[str]]
    'For Alexa Smart Home functions, a token that the invoker must supply.'
    FunctionName: Expr[str]
    'The name or ARN of the Lambda function, version, or alias.'
    FunctionUrlAuthType: NotRequired[Expr[str]]
    'The type of authentication that your function URL uses.'
    InvokedViaFunctionUrl: NotRequired[Expr[bool]]
    'Indicates whether the permission applies when the function is invoked through a function URL.'
    Principal: Expr[str]
    'The AWS-service, AWS-account, IAM user, or IAM role that invokes the function.'
    PrincipalOrgID: NotRequired[Expr[str]]
    'The identifier for your organization in AOlong.'
    SourceAccount: NotRequired[Expr[str]]
    'For AWS-service, the ID of the AWS-account that owns the resource.'
    SourceArn: NotRequired[Expr[str]]
    'For AWS-services, the ARN of the AWS resource that invokes the function.'


class Permission(ResourceAttrs):
    'The ``AWS::Lambda::Permission`` resource grants an AWS service or another account permission to use a function.'
    Type: Literal['AWS::Lambda::Permission']
    Properties: PermissionProps


def permission(
    *,
    depends_on: DependsOn | None = None,
    deletion_policy: DeletionPolicy | None = None,
    update_replace_policy: UpdateReplacePolicy | None = None,
    condition: str | None = None,
    metadata: dict[str, Any] | None = None,
    **props: Unpack[PermissionProps],
) -> Permission:
    return build('AWS::Lambda::Permission', props, depends_on, deletion_policy, update_replace_policy, condition, metadata)

Attributes

Read-only values for get_att(logical_id, attribute). They are not accepted as inputs.

  • Id