@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:00:42.445Z") @Stability(value=Experimental) public interface CustomResourceProps extends software.amazon.jsii.JsiiSerializable
| Modifier and Type | Interface and Description |
|---|---|
static class |
CustomResourceProps.Builder
A builder for
CustomResourceProps |
static class |
CustomResourceProps.Jsii$Proxy
An implementation for
CustomResourceProps |
| Modifier and Type | Method and Description |
|---|---|
static CustomResourceProps.Builder |
builder() |
default Boolean |
getPascalCaseProperties()
(experimental) Convert all property keys to pascal case.
|
default Map<String,Object> |
getProperties()
(experimental) Properties to pass to the Lambda.
|
default RemovalPolicy |
getRemovalPolicy()
(experimental) The policy to apply when this resource is removed from the application.
|
default String |
getResourceType()
(experimental) For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name.
|
String |
getServiceToken()
(experimental) The ARN of the provider which implements this custom resource type.
|
@Stability(value=Experimental) @NotNull String getServiceToken()
You can implement a provider by listening to raw AWS CloudFormation events
and specify the ARN of an SNS topic (topic.topicArn) or the ARN of an AWS
Lambda function (lambda.functionArn) or use the CDK's custom resource
provider framework which makes it easier to implement robust providers.
Provider framework:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
// use the provider framework from aws-cdk/custom-resources:
Provider provider = new Provider(this, "ResourceProvider", new ProviderProps()
.onEventHandler(onEventHandler)
.isCompleteHandler(isCompleteHandler));
new CustomResource(this, "MyResource", new CustomResourceProps()
.serviceToken(provider.getServiceToken()));
AWS Lambda function:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
// invoke an AWS Lambda function when a lifecycle event occurs:
// invoke an AWS Lambda function when a lifecycle event occurs:
new CustomResource(this, "MyResource", new CustomResourceProps()
.serviceToken(myFunction.getFunctionArn()));
SNS topic:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
// publish lifecycle events to an SNS topic:
// publish lifecycle events to an SNS topic:
new CustomResource(this, "MyResource", new CustomResourceProps()
.serviceToken(myTopic.getTopicArn()));
@Stability(value=Experimental) @Nullable default Boolean getPascalCaseProperties()
Default: false
@Stability(value=Experimental) @Nullable default Map<String,Object> getProperties()
Default: - No properties.
@Stability(value=Experimental) @Nullable default RemovalPolicy getRemovalPolicy()
Default: cdk.RemovalPolicy.Destroy
@Stability(value=Experimental) @Nullable default String getResourceType()
For example, you can use "Custom::MyCustomResourceTypeName".
Custom resource type names must begin with "Custom::" and can include alphanumeric characters and the following characters: _@-. You can specify a custom resource type name up to a maximum length of 60 characters. You cannot change the type during an update.
Using your own resource type names helps you quickly differentiate the types of custom resources in your stack. For example, if you had two custom resources that conduct two different ping tests, you could name their type as Custom::PingTester to make them easily identifiable as ping testers (instead of using AWS::CloudFormation::CustomResource).
Default: - AWS::CloudFormation::CustomResource
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html#aws-cfn-resource-type-name@Stability(value=Experimental) static CustomResourceProps.Builder builder()
CustomResourceProps.Builder of CustomResourcePropsCopyright © 2021. All rights reserved.