Class CfnPermissionProps.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.CfnPermissionProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnPermissionProps>
- Enclosing interface:
CfnPermissionProps
@Stability(Stable)
public static final class CfnPermissionProps.Builder
extends Object
implements software.amazon.jsii.Builder<CfnPermissionProps>
A builder for
CfnPermissionProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofCfnPermissionProps.getAction()build()Builds the configured instance.eventSourceToken(String eventSourceToken) Sets the value ofCfnPermissionProps.getEventSourceToken()functionName(String functionName) Sets the value ofCfnPermissionProps.getFunctionName()functionUrlAuthType(String functionUrlAuthType) Sets the value ofCfnPermissionProps.getFunctionUrlAuthType()invokedViaFunctionUrl(Boolean invokedViaFunctionUrl) Sets the value ofCfnPermissionProps.getInvokedViaFunctionUrl()invokedViaFunctionUrl(IResolvable invokedViaFunctionUrl) Sets the value ofCfnPermissionProps.getInvokedViaFunctionUrl()Sets the value ofCfnPermissionProps.getPrincipal()principalOrgId(String principalOrgId) Sets the value ofCfnPermissionProps.getPrincipalOrgId()sourceAccount(String sourceAccount) Sets the value ofCfnPermissionProps.getSourceAccount()Sets the value ofCfnPermissionProps.getSourceArn()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
action
Sets the value ofCfnPermissionProps.getAction()- Parameters:
action- The action that the principal can use on the function. This parameter is required. For example,lambda:InvokeFunctionorlambda:GetFunction.- Returns:
this
-
functionName
Sets the value ofCfnPermissionProps.getFunctionName()- Parameters:
functionName- The name or ARN of the Lambda function, version, or alias. This parameter is required. 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.
- Function ARN –
- Returns:
this
-
principal
Sets the value ofCfnPermissionProps.getPrincipal()- Parameters:
principal- The AWS service , AWS account , IAM user, or IAM role that invokes the function. This parameter is required. If you specify a service, useSourceArnorSourceAccountto limit who can invoke the function through that service.- Returns:
this
-
eventSourceToken
Sets the value ofCfnPermissionProps.getEventSourceToken()- Parameters:
eventSourceToken- For Alexa Smart Home functions, a token that the invoker must supply.- Returns:
this
-
functionUrlAuthType
@Stability(Stable) public CfnPermissionProps.Builder functionUrlAuthType(String functionUrlAuthType) Sets the value ofCfnPermissionProps.getFunctionUrlAuthType()- Parameters:
functionUrlAuthType- The type of authentication that your function URL uses. Set toAWS_IAMif you want to restrict access to authenticated users only. Set toNONEif you want to bypass IAM authentication to create a public endpoint. For more information, see Control access to Lambda function URLs .- Returns:
this
-
invokedViaFunctionUrl
@Stability(Stable) public CfnPermissionProps.Builder invokedViaFunctionUrl(Boolean invokedViaFunctionUrl) Sets the value ofCfnPermissionProps.getInvokedViaFunctionUrl()- Parameters:
invokedViaFunctionUrl- Restricts thelambda:InvokeFunctionaction to function URL calls. When set totrue, this prevents the principal from invoking the function by any means other than the function URL. For more information, see Control access to Lambda function URLs .- Returns:
this
-
invokedViaFunctionUrl
@Stability(Stable) public CfnPermissionProps.Builder invokedViaFunctionUrl(IResolvable invokedViaFunctionUrl) Sets the value ofCfnPermissionProps.getInvokedViaFunctionUrl()- Parameters:
invokedViaFunctionUrl- Restricts thelambda:InvokeFunctionaction to function URL calls. When set totrue, this prevents the principal from invoking the function by any means other than the function URL. For more information, see Control access to Lambda function URLs .- Returns:
this
-
principalOrgId
Sets the value ofCfnPermissionProps.getPrincipalOrgId()- Parameters:
principalOrgId- The identifier for your organization in AWS Organizations . Use this to grant permissions to all the AWS accounts under this organization.- Returns:
this
-
sourceAccount
Sets the value ofCfnPermissionProps.getSourceAccount()- Parameters:
sourceAccount- For AWS service , the ID of the AWS account that owns the resource. Use this together withSourceArnto 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.- Returns:
this
-
sourceArn
Sets the value ofCfnPermissionProps.getSourceArn()- Parameters:
sourceArn- For AWS services , the ARN of the AWS resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.Note that Lambda configures the comparison using the
StringLikeoperator.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CfnPermissionProps>- Returns:
- a new instance of
CfnPermissionProps - Throws:
NullPointerException- if any required attribute was not provided
-