Class AwsCustomResource
- All Implemented Interfaces:
IConstruct
,IDependable
,IGrantable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
These calls are created using a singleton Lambda function.
Use this to bridge any gap that might exist in the CloudFormation Coverage. You can specify exactly which calls are invoked for the 'CREATE', 'UPDATE' and 'DELETE' life cycle events.
Example:
AwsCustomResource awsCustom = AwsCustomResource.Builder.create(this, "aws-custom") .onCreate(AwsSdkCall.builder() .service("...") .action("...") .parameters(Map.of( "text", "...")) .physicalResourceId(PhysicalResourceId.of("...")) .build()) .onUpdate(AwsSdkCall.builder() .service("...") .action("...") .parameters(Map.of( "text", "...", "resourceId", new PhysicalResourceIdReference())) .build()) .policy(AwsCustomResourcePolicy.fromSdkCalls(SdkCallsPolicyOptions.builder() .resources(AwsCustomResourcePolicy.ANY_RESOURCE) .build())) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default, IConstruct.Jsii$Proxy
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IGrantable
IGrantable.Jsii$Default, IGrantable.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
AwsCustomResource
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
AwsCustomResource
(software.amazon.jsii.JsiiObjectRef objRef) AwsCustomResource
(software.constructs.Construct scope, String id, AwsCustomResourceProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe principal to grant permissions to.getResponseField
(String dataPath) Returns response data for the AWS SDK call as string.getResponseFieldReference
(String dataPath) Returns response data for the AWS SDK call.Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
AwsCustomResource
protected AwsCustomResource(software.amazon.jsii.JsiiObjectRef objRef) -
AwsCustomResource
protected AwsCustomResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
AwsCustomResource
@Stability(Stable) public AwsCustomResource(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AwsCustomResourceProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
getResponseField
Returns response data for the AWS SDK call as string.Example for S3 / listBucket : 'Buckets.0.Name'
Note that you cannot use this method if
ignoreErrorCodesMatching
is configured for any of the SDK calls. This is because in such a case, the response data might not exist, and will cause a CloudFormation deploy time error.- Parameters:
dataPath
- the path to the data. This parameter is required.
-
getResponseFieldReference
Returns response data for the AWS SDK call.Example for S3 / listBucket : 'Buckets.0.Name'
Use
Token.asXxx
to encode the returnedReference
as a specific type or use the conveniencegetDataString
for string attributes.Note that you cannot use this method if
ignoreErrorCodesMatching
is configured for any of the SDK calls. This is because in such a case, the response data might not exist, and will cause a CloudFormation deploy time error.- Parameters:
dataPath
- the path to the data. This parameter is required.
-
getGrantPrincipal
The principal to grant permissions to.- Specified by:
getGrantPrincipal
in interfaceIGrantable
-