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
-
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()
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:InvokeFunction
orlambda: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, useSourceArn
orSourceAccount
to 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_IAM
if you want to restrict access to authenticated users only. Set toNONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for 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 withSourceArn
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.- 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
StringLike
operator.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnPermissionProps>
- Returns:
- a new instance of
CfnPermissionProps
- Throws:
NullPointerException
- if any required attribute was not provided
-