Class CfnPermissionPropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.lambda.CfnPermissionPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:20:00.938Z") @Stability(Stable) public class CfnPermissionPropsMixin extends Mixin implements software.constructs.IMixin
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 .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cfnpropertymixins.services.lambda.*;
 import software.amazon.awscdk.*;
 IMergeStrategy mergeStrategy;
 CfnPermissionPropsMixin cfnPermissionPropsMixin = CfnPermissionPropsMixin.Builder.create(CfnPermissionMixinProps.builder()
         .action("action")
         .eventSourceToken("eventSourceToken")
         .functionName("functionName")
         .functionUrlAuthType("functionUrlAuthType")
         .invokedViaFunctionUrl(false)
         .principal("principal")
         .principalOrgId("principalOrgId")
         .sourceAccount("sourceAccount")
         .sourceArn("sourceArn")
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnPermissionPropsMixin

      protected CfnPermissionPropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnPermissionPropsMixin

      protected CfnPermissionPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnPermissionPropsMixin

      @Stability(Stable) public CfnPermissionPropsMixin(@NotNull CfnPermissionMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::Lambda::Permission.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnPermissionPropsMixin

      @Stability(Stable) public CfnPermissionPropsMixin(@NotNull CfnPermissionMixinProps props)
      Create a mixin to apply properties to AWS::Lambda::Permission.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnPermissionMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()