Class CfnCustomResource

All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:54.836Z") @Stability(Stable) public class CfnCustomResource extends CfnResource implements IInspectable
A CloudFormation AWS::CloudFormation::CustomResource.

In a CloudFormation template, you use the AWS::CloudFormation::CustomResource or Custom:: *String* resource type to specify custom resources.

Custom resources provide a way for you to write custom provisioning logic in CloudFormation template and have CloudFormation run it during a stack operation, such as when you create, update or delete a stack. For more information, see Custom resources .

If you use the VPC endpoints feature, custom resources in the VPC must have access to CloudFormation -specific Amazon Simple Storage Service ( Amazon S3 ) buckets. Custom resources must send responses to a presigned Amazon S3 URL. If they can't send responses to Amazon S3 , CloudFormation won't receive a response and the stack operation fails. For more information, see Setting up VPC endpoints for AWS CloudFormation .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.core.*;
 CfnCustomResource cfnCustomResource = CfnCustomResource.Builder.create(this, "MyCfnCustomResource")
         .serviceToken("serviceToken")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnCustomResource

      protected CfnCustomResource(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnCustomResource

      protected CfnCustomResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnCustomResource

      @Stability(Stable) public CfnCustomResource(@NotNull Construct scope, @NotNull String id, @NotNull CfnCustomResourceProps props)
      Create a new AWS::CloudFormation::CustomResource.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getServiceToken

      @Stability(Stable) @NotNull public String getServiceToken()

      Only one property is defined by AWS for a custom resource: ServiceToken .

      All other properties are defined by the service provider.

      The service token that was given to the template developer by the service provider to access the service, such as an Amazon SNS topic ARN or Lambda function ARN. The service token must be from the same Region in which you are creating the stack.

      Updates aren't supported.

    • setServiceToken

      @Stability(Stable) public void setServiceToken(@NotNull String value)

      Only one property is defined by AWS for a custom resource: ServiceToken .

      All other properties are defined by the service provider.

      The service token that was given to the template developer by the service provider to access the service, such as an Amazon SNS topic ARN or Lambda function ARN. The service token must be from the same Region in which you are creating the stack.

      Updates aren't supported.