CfnPermissionProps Struct
Properties for defining a CfnPermission.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const cfnPermissionProps: lambda.CfnPermissionProps = {
action: 'action',
functionName: 'functionName',
principal: 'principal',
// the properties below are optional
eventSourceToken: 'eventSourceToken',
functionUrlAuthType: 'functionUrlAuthType',
invokedViaFunctionUrl: false,
principalOrgId: 'principalOrgId',
sourceAccount: 'sourceAccount',
sourceArn: 'sourceArn',
};
Properties
For example, lambda:InvokeFunction or lambda:GetFunction .
eventSourceTokenstringevent_source_tokenstreventSourceTokenStringEventSourceTokenstringEventSourceToken*string#functionNamestring | IFunctionRef | IVersionReffunction_nametyping.Union[str, IFunctionRef, IVersionRef]functionNameStringFunctionNamestringFunctionNameinterface{}required#notes
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 specify only the function name, it is limited to 64 characters in length.
functionUrlAuthTypestringfunction_url_auth_typestrfunctionUrlAuthTypeStringFunctionUrlAuthTypestringFunctionUrlAuthType*string#notes
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 .
invokedViaFunctionUrlboolean | IResolvableinvoked_via_function_urltyping.Union[bool, IResolvable]invokedViaFunctionUrlBooleanInvokedViaFunctionUrlboolInvokedViaFunctionUrlinterface{}#principalstring | IRoleRef | IUserRefprincipaltyping.Union[str, IRoleRef, IUserRef]principalStringPrincipalstringPrincipalinterface{}required#If you specify a service, use SourceArn or SourceAccount to limit who can invoke the function through that service.
principalOrgIdstringprincipal_org_idstrprincipalOrgIdStringPrincipalOrgIdstringPrincipalOrgId*string#Use this to grant permissions to all the AWS accounts under this organization.
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.
sourceArnstring | IUserPoolRef | IRuleRef | IRoleRef | ITopicRuleRef | IDeliveryStreamRef | IFunctionRef | ILogGroupRef | IBucketRef | ITopicRef | IQueueRefsource_arntyping.Union[str, IUserPoolRef, IRuleRef, IRoleRef, ITopicRuleRef, IDeliveryStreamRef, IFunctionRef, ILogGroupRef, IBucketRef, ITopicRef, IQueueRef]sourceArnStringSourceArnstringSourceArninterface{}#For example, an Amazon S3 bucket or Amazon SNS topic.
Note that Lambda configures the comparison using the StringLike operator.