Class CustomResource.Builder

java.lang.Object
software.amazon.awscdk.services.cloudformation.CustomResource.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CustomResource>
Enclosing class:
CustomResource

@Stability(Deprecated) @Deprecated public static final class CustomResource.Builder extends Object implements software.amazon.jsii.Builder<CustomResource>
Deprecated.
(deprecated) A fluent builder for CustomResource.
  • Method Details

    • create

      @Stability(Deprecated) @Deprecated public static CustomResource.Builder create(Construct scope, String id)
      Deprecated.
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of CustomResource.Builder.
    • provider

      @Stability(Deprecated) @Deprecated public CustomResource.Builder provider(ICustomResourceProvider provider)
      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);
       

      Parameters:
      provider - The provider which implements the custom resource. This parameter is required.
      Returns:
      this
    • properties

      @Stability(Deprecated) @Deprecated public CustomResource.Builder properties(Map<String,? extends Object> properties)
      Deprecated.
      (deprecated) Properties to pass to the Lambda.

      Default: - No properties.

      Parameters:
      properties - Properties to pass to the Lambda. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Deprecated) @Deprecated public CustomResource.Builder removalPolicy(RemovalPolicy removalPolicy)
      Deprecated.
      (deprecated) The policy to apply when this resource is removed from the application.

      Default: cdk.RemovalPolicy.Destroy

      Parameters:
      removalPolicy - The policy to apply when this resource is removed from the application. This parameter is required.
      Returns:
      this
    • resourceType

      @Stability(Deprecated) @Deprecated public CustomResource.Builder resourceType(String resourceType)
      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

      Parameters:
      resourceType - For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name. This parameter is required.
      Returns:
      this
      See Also:
    • build

      @Stability(Deprecated) @Deprecated public CustomResource build()
      Deprecated.
      Specified by:
      build in interface software.amazon.jsii.Builder<CustomResource>
      Returns:
      a newly built instance of CustomResource.