@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:34.959Z") public class CustomResource extends Resource
This class is intended to be used by construct library authors. Application builder should not be able to tell whether or not a construct is backed by a custom resource, and so the use of this class should be invisible.
Instead, construct library authors declare a custom construct that hides the choice of provider, and accepts a strongly-typed properties object with the properties your provider accepts.
Your custom resource provider (identified by the serviceToken
property)
can be one of 4 constructs:
Provider
class in the custom-resources
module.CustomResourceProvider
construct in this package.serviceToken
.Example:
String serviceToken = CustomResourceProvider.getOrCreate(this, "Custom::MyCustomResourceType", CustomResourceProviderProps.builder() .codeDirectory(String.format("%s/my-handler", __dirname)) .runtime(CustomResourceProviderRuntime.NODEJS_14_X) .description("Lambda function created by the custom resource provider") .build()); CustomResource.Builder.create(this, "MyResource") .resourceType("Custom::MyCustomResourceType") .serviceToken(serviceToken) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CustomResource.Builder
A fluent builder for
CustomResource . |
IResource.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
CustomResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CustomResource(software.amazon.jsii.JsiiObjectRef objRef) |
|
CustomResource(software.constructs.Construct scope,
java.lang.String id,
CustomResourceProps props) |
Modifier and Type | Method and Description |
---|---|
Reference |
getAtt(java.lang.String attributeName)
Returns the value of an attribute of the custom resource of an arbitrary type.
|
java.lang.String |
getAttString(java.lang.String attributeName)
Returns the value of an attribute of the custom resource of type string.
|
java.lang.String |
getRef()
The physical name of this custom resource.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNode
protected CustomResource(software.amazon.jsii.JsiiObjectRef objRef)
protected CustomResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CustomResource(software.constructs.Construct scope, java.lang.String id, CustomResourceProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public Reference getAtt(java.lang.String attributeName)
Attributes are returned from the custom resource provider through the
Data
map where the key is the attribute name.
attributeName
- the name of the attribute. This parameter is required.public java.lang.String getAttString(java.lang.String attributeName)
Attributes are returned from the custom resource provider through the
Data
map where the key is the attribute name.
attributeName
- the name of the attribute. This parameter is required.public java.lang.String getRef()