CfnPermissionProps Struct
Properties for defining a CfnPermission.
| Source | |
|---|---|
| Type last changed |
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',
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_
cfn_permission_props = lambda.CfnPermissionProps(
action="action",
function_name="functionName",
principal="principal",
# the properties below are optional
event_source_token="eventSourceToken",
function_url_auth_type="functionUrlAuthType",
invoked_via_function_url=False,
principal_org_id="principalOrgId",
source_account="sourceAccount",
source_arn="sourceArn"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.*;
CfnPermissionProps cfnPermissionProps = CfnPermissionProps.builder()
.action("action")
.functionName("functionName")
.principal("principal")
// the properties below are optional
.eventSourceToken("eventSourceToken")
.functionUrlAuthType("functionUrlAuthType")
.invokedViaFunctionUrl(false)
.principalOrgId("principalOrgId")
.sourceAccount("sourceAccount")
.sourceArn("sourceArn")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;
var cfnPermissionProps = new CfnPermissionProps {
Action = "action",
FunctionName = "functionName",
Principal = "principal",
// the properties below are optional
EventSourceToken = "eventSourceToken",
FunctionUrlAuthType = "functionUrlAuthType",
InvokedViaFunctionUrl = false,
PrincipalOrgId = "principalOrgId",
SourceAccount = "sourceAccount",
SourceArn = "sourceArn"
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnPermissionProps := &CfnPermissionProps{
Action: jsii.String("action"),
FunctionName: jsii.String("functionName"),
Principal: jsii.String("principal"),
// the properties below are optional
EventSourceToken: jsii.String("eventSourceToken"),
FunctionUrlAuthType: jsii.String("functionUrlAuthType"),
InvokedViaFunctionUrl: jsii.Boolean(false),
PrincipalOrgId: jsii.String("principalOrgId"),
SourceAccount: jsii.String("sourceAccount"),
SourceArn: jsii.String("sourceArn"),
}
Properties
For example, lambda:InvokeFunction or lambda:GetFunction .
eventSourceTokenoptionalstringevent_source_tokenoptionalstreventSourceTokenoptionalStringEventSourceTokenoptionalstringEventSourceTokenoptional*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.
functionUrlAuthTypeoptionalstringfunction_url_auth_typeoptionalstrfunctionUrlAuthTypeoptionalStringFunctionUrlAuthTypeoptionalstringFunctionUrlAuthTypeoptional*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 .
invokedViaFunctionUrloptionalboolean | IResolvableinvoked_via_function_urloptionaltyping.Union[bool, IResolvable]invokedViaFunctionUrloptionalBooleanInvokedViaFunctionUrloptionalboolInvokedViaFunctionUrloptionalinterface{} #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.
principalOrgIdoptionalstringprincipal_org_idoptionalstrprincipalOrgIdoptionalStringPrincipalOrgIdoptionalstringPrincipalOrgIdoptional*string #Use this to grant permissions to all the AWS accounts under this organization.
sourceAccountoptionalstringsource_accountoptionalstrsourceAccountoptionalStringSourceAccountoptionalstringSourceAccountoptional*string #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.
sourceArnoptionalstring | IUserPoolRef | IRuleRef | IRoleRef | ITopicRuleRef | IDeliveryStreamRef | IFunctionRef | ILogGroupRef | IBucketRef | ITopicRef | IQueueRefsource_arnoptionaltyping.Union[str, IUserPoolRef, IRuleRef, IRoleRef, ITopicRuleRef, IDeliveryStreamRef, IFunctionRef, ILogGroupRef, IBucketRef, ITopicRef, IQueueRef]sourceArnoptionalStringSourceArnoptionalstringSourceArnoptionalinterface{} #For example, an Amazon S3 bucket or Amazon SNS topic.
Note that Lambda configures the comparison using the StringLike operator.