Class FunctionAttributes.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.FunctionAttributes.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<FunctionAttributes>
- Enclosing interface:
FunctionAttributes
@Stability(Stable)
public static final class FunctionAttributes.Builder
extends Object
implements software.amazon.jsii.Builder<FunctionAttributes>
A builder for
FunctionAttributes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionarchitecture
(Architecture architecture) Sets the value ofFunctionAttributes.getArchitecture()
build()
Builds the configured instance.functionArn
(String functionArn) Sets the value ofFunctionAttributes.getFunctionArn()
Sets the value ofFunctionAttributes.getRole()
sameEnvironment
(Boolean sameEnvironment) Sets the value ofFunctionAttributes.getSameEnvironment()
securityGroup
(ISecurityGroup securityGroup) Sets the value ofFunctionAttributes.getSecurityGroup()
skipPermissions
(Boolean skipPermissions) Sets the value ofFunctionAttributes.getSkipPermissions()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
functionArn
Sets the value ofFunctionAttributes.getFunctionArn()
- Parameters:
functionArn
- The ARN of the Lambda function. This parameter is required. Format: arn::lambda: :invalid input: '<'account-id>:function:invalid input: '<'function-name> - Returns:
this
-
architecture
Sets the value ofFunctionAttributes.getArchitecture()
- Parameters:
architecture
- The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).- Returns:
this
-
role
Sets the value ofFunctionAttributes.getRole()
- Parameters:
role
- The IAM execution role associated with this function. If the role is not specified, any role-related operations will no-op.- Returns:
this
-
sameEnvironment
Sets the value ofFunctionAttributes.getSameEnvironment()
- Parameters:
sameEnvironment
- Setting this property informs the CDK that the imported function is in the same environment as the stack. This affects certain behaviours such as, whether this function's permission can be modified. When not configured, the CDK attempts to auto-determine this. For environment agnostic stacks, i.e., stacks where the account is not specified with theenv
property, this is determined to be false.Set this to property ONLY IF the imported function is in the same account as the stack it's imported in.
- Returns:
this
-
securityGroup
Sets the value ofFunctionAttributes.getSecurityGroup()
- Parameters:
securityGroup
- The security group of this Lambda, if in a VPC. This needs to be given in order to support allowing connections to this Lambda.- Returns:
this
-
skipPermissions
Sets the value ofFunctionAttributes.getSkipPermissions()
- Parameters:
skipPermissions
- Setting this property informs the CDK that the imported function ALREADY HAS the necessary permissions for what you are trying to do. When not configured, the CDK attempts to auto-determine whether or not additional permissions are necessary on the function when grant APIs are used. If the CDK tried to add permissions on an imported lambda, it will fail.Set this property ONLY IF you are committing to manage the imported function's permissions outside of CDK. You are acknowledging that your CDK code alone will have insufficient permissions to access the imported function.
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<FunctionAttributes>
- Returns:
- a new instance of
FunctionAttributes
- Throws:
NullPointerException
- if any required attribute was not provided
-