public static final class AwsCustomResourceProps.Builder
extends java.lang.Object
AwsCustomResourceProps
Constructor and Description |
---|
Builder() |
public AwsCustomResourceProps.Builder policy(AwsCustomResourcePolicy policy)
AwsCustomResourceProps.getPolicy()
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 implements iam.IGrantable
, making it possible
to use the grantXxx()
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.
this
public AwsCustomResourceProps.Builder functionName(java.lang.String functionName)
AwsCustomResourceProps.getFunctionName()
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.this
public AwsCustomResourceProps.Builder installLatestAwsSdk(java.lang.Boolean installLatestAwsSdk)
AwsCustomResourceProps.getInstallLatestAwsSdk()
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.this
public AwsCustomResourceProps.Builder logRetention(RetentionDays logRetention)
AwsCustomResourceProps.getLogRetention()
logRetention
- The number of days log events of the singleton Lambda function implementing this custom resource are kept in CloudWatch Logs.this
public AwsCustomResourceProps.Builder onCreate(AwsSdkCall onCreate)
AwsCustomResourceProps.getOnCreate()
onCreate
- The AWS SDK call to make when the resource is created.this
public AwsCustomResourceProps.Builder onDelete(AwsSdkCall onDelete)
AwsCustomResourceProps.getOnDelete()
onDelete
- The AWS SDK call to make when the resource is deleted.this
public AwsCustomResourceProps.Builder onUpdate(AwsSdkCall onUpdate)
AwsCustomResourceProps.getOnUpdate()
onUpdate
- The AWS SDK call to make when the resource is updated.this
public AwsCustomResourceProps.Builder resourceType(java.lang.String resourceType)
AwsCustomResourceProps.getResourceType()
resourceType
- Cloudformation Resource type.this
public AwsCustomResourceProps.Builder role(IRole role)
AwsCustomResourceProps.getRole()
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 the
lambda.amazonaws.com
service principal.this
public AwsCustomResourceProps.Builder timeout(Duration timeout)
AwsCustomResourceProps.getTimeout()
timeout
- The timeout for the singleton Lambda function implementing this custom resource.this
public AwsCustomResourceProps build()
AwsCustomResourceProps
java.lang.NullPointerException
- if any required attribute was not provided