@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-14T16:25:30.409Z") public class CfnCustomResource extends CfnResource implements IInspectable
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.services.cloudformation.*; CfnCustomResource cfnCustomResource = CfnCustomResource.Builder.create(this, "MyCfnCustomResource") .serviceToken("serviceToken") .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnCustomResource.Builder
A fluent builder for
CfnCustomResource . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnCustomResource(Construct scope,
java.lang.String id,
CfnCustomResourceProps props)
Create a new `AWS::CloudFormation::CustomResource`.
|
protected |
CfnCustomResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnCustomResource(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getServiceToken()
> Only one property is defined by AWS for a custom resource: `ServiceToken` .
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setServiceToken(java.lang.String value)
> Only one property is defined by AWS for a custom resource: `ServiceToken` .
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnCustomResource(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnCustomResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnCustomResource(Construct scope, java.lang.String id, CfnCustomResourceProps props)
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.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.String getServiceToken()
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.
public void setServiceToken(java.lang.String value)
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.