Class AwsCustomResourceProps.Builder
java.lang.Object
software.amazon.awscdk.customresources.AwsCustomResourceProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<AwsCustomResourceProps>
- Enclosing interface:
AwsCustomResourceProps
@Stability(Stable)
public static final class AwsCustomResourceProps.Builder
extends Object
implements software.amazon.jsii.Builder<AwsCustomResourceProps>
A builder for
AwsCustomResourceProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.functionName
(String functionName) Sets the value ofAwsCustomResourceProps.getFunctionName()
installLatestAwsSdk
(Boolean installLatestAwsSdk) Sets the value ofAwsCustomResourceProps.getInstallLatestAwsSdk()
logRetention
(RetentionDays logRetention) Sets the value ofAwsCustomResourceProps.getLogRetention()
onCreate
(AwsSdkCall onCreate) Sets the value ofAwsCustomResourceProps.getOnCreate()
onDelete
(AwsSdkCall onDelete) Sets the value ofAwsCustomResourceProps.getOnDelete()
onUpdate
(AwsSdkCall onUpdate) Sets the value ofAwsCustomResourceProps.getOnUpdate()
policy
(AwsCustomResourcePolicy policy) Sets the value ofAwsCustomResourceProps.getPolicy()
resourceType
(String resourceType) Sets the value ofAwsCustomResourceProps.getResourceType()
Sets the value ofAwsCustomResourceProps.getRole()
Sets the value ofAwsCustomResourceProps.getTimeout()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
policy
Sets the value ofAwsCustomResourceProps.getPolicy()
- Parameters:
policy
- The policy that will be added to the execution role of the Lambda function implementing this custom resource provider. This parameter is required. The custom resource also implementsiam.IGrantable
, making it possible to use thegrantXxx()
methods.As this custom resource uses a singleton Lambda function, it's important to note the that function's role will eventually accumulate the permissions/grants from all resources.
- Returns:
this
-
functionName
Sets the value ofAwsCustomResourceProps.getFunctionName()
- Parameters:
functionName
- A name for the singleton Lambda function implementing this custom resource. The function name will remain the same after the first AwsCustomResource is created in a stack.- Returns:
this
-
installLatestAwsSdk
@Stability(Stable) public AwsCustomResourceProps.Builder installLatestAwsSdk(Boolean installLatestAwsSdk) Sets the value ofAwsCustomResourceProps.getInstallLatestAwsSdk()
- Parameters:
installLatestAwsSdk
- Whether to install the latest AWS SDK v2. Allows to use the latest API calls documented at https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html. The installation takes around 60 seconds.- Returns:
this
-
logRetention
Sets the value ofAwsCustomResourceProps.getLogRetention()
- Parameters:
logRetention
- The number of days log events of the singleton Lambda function implementing this custom resource are kept in CloudWatch Logs.- Returns:
this
-
onCreate
Sets the value ofAwsCustomResourceProps.getOnCreate()
- Parameters:
onCreate
- The AWS SDK call to make when the resource is created.- Returns:
this
-
onDelete
Sets the value ofAwsCustomResourceProps.getOnDelete()
- Parameters:
onDelete
- The AWS SDK call to make when the resource is deleted.- Returns:
this
-
onUpdate
Sets the value ofAwsCustomResourceProps.getOnUpdate()
- Parameters:
onUpdate
- The AWS SDK call to make when the resource is updated.- Returns:
this
-
resourceType
Sets the value ofAwsCustomResourceProps.getResourceType()
- Parameters:
resourceType
- Cloudformation Resource type.- Returns:
this
-
role
Sets the value ofAwsCustomResourceProps.getRole()
- Parameters:
role
- The execution role for the singleton Lambda function implementing this custom resource provider. This role will apply to allAwsCustomResource
instances in the stack. The role must be assumable by thelambda.amazonaws.com
service principal.- Returns:
this
-
timeout
Sets the value ofAwsCustomResourceProps.getTimeout()
- Parameters:
timeout
- The timeout for the singleton Lambda function implementing this custom resource.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<AwsCustomResourceProps>
- Returns:
- a new instance of
AwsCustomResourceProps
- Throws:
NullPointerException
- if any required attribute was not provided
-