Class AwsCustomResource.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<AwsCustomResource>
- Enclosing class:
- AwsCustomResource
AwsCustomResource
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
static AwsCustomResource.Builder
functionName
(String functionName) A name for the singleton Lambda function implementing this custom resource.installLatestAwsSdk
(Boolean installLatestAwsSdk) Whether to install the latest AWS SDK v2.logRetention
(RetentionDays logRetention) The number of days log events of the singleton Lambda function implementing this custom resource are kept in CloudWatch Logs.onCreate
(AwsSdkCall onCreate) The AWS SDK call to make when the resource is created.onDelete
(AwsSdkCall onDelete) The AWS SDK call to make when the resource is deleted.onUpdate
(AwsSdkCall onUpdate) The AWS SDK call to make when the resource is updated.policy
(AwsCustomResourcePolicy policy) The policy that will be added to the execution role of the Lambda function implementing this custom resource provider.resourceType
(String resourceType) Cloudformation Resource type.The execution role for the singleton Lambda function implementing this custom resource provider.The timeout for the singleton Lambda function implementing this custom resource.
-
Method Details
-
create
@Stability(Stable) public static AwsCustomResource.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
AwsCustomResource.Builder
.
-
policy
The policy that will be added to the execution role of the Lambda function implementing this custom resource provider.The custom resource also implements
iam.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.
- 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.- Returns:
this
- See Also:
-
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.
Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the function's name. For more information, see Name Type.
- Parameters:
functionName
- A name for the singleton Lambda function implementing this custom resource. This parameter is required.- Returns:
this
-
installLatestAwsSdk
@Stability(Stable) public AwsCustomResource.Builder installLatestAwsSdk(Boolean 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.
Default: true
- 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. This parameter is required.- Returns:
this
-
logRetention
The number of days log events of the singleton Lambda function implementing this custom resource are kept in CloudWatch Logs.Default: logs.RetentionDays.INFINITE
- Parameters:
logRetention
- The number of days log events of the singleton Lambda function implementing this custom resource are kept in CloudWatch Logs. This parameter is required.- Returns:
this
-
onCreate
The AWS SDK call to make when the resource is created.Default: - the call when the resource is updated
- Parameters:
onCreate
- The AWS SDK call to make when the resource is created. This parameter is required.- Returns:
this
-
onDelete
The AWS SDK call to make when the resource is deleted.Default: - no call
- Parameters:
onDelete
- The AWS SDK call to make when the resource is deleted. This parameter is required.- Returns:
this
-
onUpdate
The AWS SDK call to make when the resource is updated.Default: - no call
- Parameters:
onUpdate
- The AWS SDK call to make when the resource is updated. This parameter is required.- Returns:
this
-
resourceType
Cloudformation Resource type.Default: - Custom::AWS
- Parameters:
resourceType
- Cloudformation Resource type. This parameter is required.- Returns:
this
-
role
The execution role for the singleton Lambda function implementing this custom resource provider.This role will apply to all
AwsCustomResource
instances in the stack. The role must be assumable by thelambda.amazonaws.com
service principal.Default: - a new role is created
- Parameters:
role
- The execution role for the singleton Lambda function implementing this custom resource provider. This parameter is required.- Returns:
this
-
timeout
The timeout for the singleton Lambda function implementing this custom resource.Default: Duration.minutes(2)
- Parameters:
timeout
- The timeout for the singleton Lambda function implementing this custom resource. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<AwsCustomResource>
- Returns:
- a newly built instance of
AwsCustomResource
.
-