@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.890Z") @Stability(value=Stable) public interface AwsCustomResourceProps extends software.amazon.jsii.JsiiSerializable
Note that at least onCreate, onUpdate or onDelete must be specified.
Example:
AwsCustomResource getParameter = AwsCustomResource.Builder.create(this, "GetParameter")
.onUpdate(AwsSdkCall.builder() // will also be called for a CREATE event
.service("SSM")
.action("getParameter")
.parameters(Map.of(
"Name", "my-parameter",
"WithDecryption", true))
.physicalResourceId(PhysicalResourceId.of(Date.now().toString())).build())
.policy(AwsCustomResourcePolicy.fromSdkCalls(SdkCallsPolicyOptions.builder()
.resources(AwsCustomResourcePolicy.ANY_RESOURCE)
.build()))
.build();
// Use the value in another construct with
getParameter.getResponseField("Parameter.Value");
| Modifier and Type | Interface and Description |
|---|---|
static class |
AwsCustomResourceProps.Builder
A builder for
AwsCustomResourceProps |
static class |
AwsCustomResourceProps.Jsii$Proxy
An implementation for
AwsCustomResourceProps |
| Modifier and Type | Method and Description |
|---|---|
static AwsCustomResourceProps.Builder |
builder() |
default String |
getFunctionName()
A name for the singleton Lambda function implementing this custom resource.
|
default Boolean |
getInstallLatestAwsSdk()
Whether to install the latest AWS SDK v2.
|
default RetentionDays |
getLogRetention()
The number of days log events of the singleton Lambda function implementing this custom resource are kept in CloudWatch Logs.
|
default AwsSdkCall |
getOnCreate()
The AWS SDK call to make when the resource is created.
|
default AwsSdkCall |
getOnDelete()
The AWS SDK call to make when the resource is deleted.
|
default AwsSdkCall |
getOnUpdate()
The AWS SDK call to make when the resource is updated.
|
default AwsCustomResourcePolicy |
getPolicy()
The policy that will be added to the execution role of the Lambda function implementing this custom resource provider.
|
default String |
getResourceType()
Cloudformation Resource type.
|
default IRole |
getRole()
The execution role for the singleton Lambda function implementing this custom resource provider.
|
default Duration |
getTimeout()
The timeout for the singleton Lambda function implementing this custom resource.
|
default IVpc |
getVpc()
The vpc to provision the lambda function in.
|
default SubnetSelection |
getVpcSubnets()
Which subnets from the VPC to place the lambda function in.
|
@Stability(value=Stable) @Nullable default String getFunctionName()
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.
@Stability(value=Stable) @Nullable default Boolean getInstallLatestAwsSdk()
The installation takes around 60 seconds.
Default: true
@Stability(value=Stable) @Nullable default RetentionDays getLogRetention()
Default: logs.RetentionDays.INFINITE
@Stability(value=Stable) @Nullable default AwsSdkCall getOnCreate()
Default: - the call when the resource is updated
@Stability(value=Stable) @Nullable default AwsSdkCall getOnDelete()
Default: - no call
@Stability(value=Stable) @Nullable default AwsSdkCall getOnUpdate()
Default: - no call
@Stability(value=Stable) @Nullable default AwsCustomResourcePolicy getPolicy()
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.
Note that a policy must be specified if role is not provided, as
by default a new role is created which requires policy changes to access
resources.
Default: - no policy added
@Stability(value=Stable) @Nullable default String getResourceType()
Default: - Custom::AWS
@Stability(value=Stable) @Nullable default IRole getRole()
This role will apply to all AwsCustomResource
instances in the stack. The role must be assumable by the
lambda.amazonaws.com service principal.
Default: - a new role is created
@Stability(value=Stable) @Nullable default Duration getTimeout()
Default: Duration.minutes(2)
@Stability(value=Stable) @Nullable default IVpc getVpc()
Default: - the function is not provisioned inside a vpc.
@Stability(value=Stable) @Nullable default SubnetSelection getVpcSubnets()
Only used if 'vpc' is supplied. Note: internet access for Lambdas requires a NAT gateway, so picking Public subnets is not allowed.
Default: - the Vpc default strategy if not specified
@Stability(value=Stable) static AwsCustomResourceProps.Builder builder()
AwsCustomResourceProps.Builder of AwsCustomResourcePropsCopyright © 2022. All rights reserved.