Class CfnPermissionPropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnPermissionPropsMixin.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::Lambda::Permission.CfnPermissionPropsMixin(CfnPermissionMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::Lambda::Permission.protectedCfnPermissionPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnPermissionPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnPermissionMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 toAWS::Lambda::Permission.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnPermissionPropsMixin
Create a mixin to apply properties toAWS::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. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-