class CfnPermissionPropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.Lambda.Mixins.CfnPermissionPropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awslambda/mixins#CfnPermissionPropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.lambda.mixins.CfnPermissionPropsMixin |
Python | aws_cdk.mixins_preview.aws_lambda.mixins.CfnPermissionPropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_lambda » mixins » CfnPermissionPropsMixin |
Implements
IMixin
Extends
Mixin
The AWS::Lambda::Permission resource grants an AWS service or another account 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.
To grant permission to another account, specify the account ID as the Principal . To grant permission to an organization defined in AWS Organizations , specify the organization ID as the PrincipalOrgID . For AWS services, the principal is a domain-style identifier defined by the service, like s3.amazonaws.com or sns.amazonaws.com . For AWS services, you can also specify the ARN of the associated resource as the SourceArn . If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function.
If your function has a function URL, you can specify the FunctionUrlAuthType parameter. This adds a condition to your permission that only applies when your function URL's AuthType matches the specified FunctionUrlAuthType . For more information about the AuthType parameter, see Control access to Lambda function URLs .
This resource adds a statement to a resource-based permission policy for the function. For more information about function policies, see Lambda Function Policies .
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as lambda_mixins } from '@aws-cdk/mixins-preview/aws-lambda';
const cfnPermissionPropsMixin = new lambda_mixins.CfnPermissionPropsMixin({
action: 'action',
eventSourceToken: 'eventSourceToken',
functionName: 'functionName',
functionUrlAuthType: 'functionUrlAuthType',
invokedViaFunctionUrl: false,
principal: 'principal',
principalOrgId: 'principalOrgId',
sourceAccount: 'sourceAccount',
sourceArn: 'sourceArn',
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnPermissionPropsMixin(props: CfnPermissionMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Permission Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::Lambda::Permission.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): IConstruct
Parameters
- construct
IConstruct
Returns
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript