Interface CustomResourceProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CustomResourceProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:41.603Z") @Stability(Deprecated) @Deprecated public interface CustomResourceProps extends software.amazon.jsii.JsiiSerializable
Deprecated.
use core.CustomResourceProps
(deprecated) Properties to provide a Lambda-backed custom resource.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.cloudformation.*;
 import software.amazon.awscdk.core.*;
 CustomResourceProvider customResourceProvider;
 Object properties;
 CustomResourceProps customResourceProps = CustomResourceProps.builder()
         .provider(customResourceProvider)
         // the properties below are optional
         .properties(Map.of(
                 "propertiesKey", properties))
         .removalPolicy(RemovalPolicy.DESTROY)
         .resourceType("resourceType")
         .build();
 

  • Method Details

    • getProvider

      @Stability(Deprecated) @Deprecated @NotNull ICustomResourceProvider getProvider()
      Deprecated.
      (deprecated) The provider which implements the custom resource.

      You can implement a provider by listening to raw AWS CloudFormation events through an SNS topic or an AWS Lambda function or use the CDK's custom resource provider framework which makes it easier to implement robust providers.

       import software.amazon.awscdk.customresources.*;
       import software.amazon.awscdk.services.lambda.*;
       import software.amazon.awscdk.core.Stack;
       Function myOnEventLambda;
       Function myIsCompleteLambda;
       Stack stack = new Stack();
       Provider provider = Provider.Builder.create(stack, "myProvider")
               .onEventHandler(myOnEventLambda)
               .isCompleteHandler(myIsCompleteLambda)
               .build();
       

       import software.amazon.awscdk.services.cloudformation.*;
       import software.amazon.awscdk.services.lambda.*;
       Function myFunction;
       // invoke an AWS Lambda function when a lifecycle event occurs:
       CustomResourceProvider provider = CustomResourceProvider.fromLambda(myFunction);
       

       import software.amazon.awscdk.services.cloudformation.*;
       import software.amazon.awscdk.services.sns.*;
       Topic myTopic;
       // publish lifecycle events to an SNS topic:
       CustomResourceProvider provider = CustomResourceProvider.fromTopic(myTopic);
       
    • getProperties

      @Stability(Deprecated) @Deprecated @Nullable default Map<String,Object> getProperties()
      Deprecated.
      (deprecated) Properties to pass to the Lambda.

      Default: - No properties.

    • getRemovalPolicy

      @Stability(Deprecated) @Deprecated @Nullable default RemovalPolicy getRemovalPolicy()
      Deprecated.
      (deprecated) The policy to apply when this resource is removed from the application.

      Default: cdk.RemovalPolicy.Destroy

    • getResourceType

      @Stability(Deprecated) @Deprecated @Nullable default String getResourceType()
      Deprecated.
      (deprecated) For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name.

      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

      See Also:
    • builder

      @Stability(Deprecated) @Deprecated static CustomResourceProps.Builder builder()
      Deprecated.
      Returns:
      a CustomResourceProps.Builder of CustomResourceProps