@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:45.220Z") public class AwsCustomResource extends Construct implements IGrantable
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();
Modifier and Type | Class and Description |
---|---|
static class |
AwsCustomResource.Builder
A fluent builder for
AwsCustomResource . |
IGrantable.Jsii$Default, IGrantable.Jsii$Proxy
IConstruct.Jsii$Default, IConstruct.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
AwsCustomResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
AwsCustomResource(software.amazon.jsii.JsiiObjectRef objRef) |
|
AwsCustomResource(software.constructs.Construct scope,
java.lang.String id,
AwsCustomResourceProps props) |
Modifier and Type | Method and Description |
---|---|
IPrincipal |
getGrantPrincipal()
The principal to grant permissions to.
|
java.lang.String |
getResponseField(java.lang.String dataPath)
Returns response data for the AWS SDK call as string.
|
Reference |
getResponseFieldReference(java.lang.String dataPath)
Returns response data for the AWS SDK call.
|
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
protected AwsCustomResource(software.amazon.jsii.JsiiObjectRef objRef)
protected AwsCustomResource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public AwsCustomResource(software.constructs.Construct scope, java.lang.String id, AwsCustomResourceProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public java.lang.String getResponseField(java.lang.String dataPath)
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.
dataPath
- the path to the data. This parameter is required.public Reference getResponseFieldReference(java.lang.String dataPath)
Example for S3 / listBucket : 'Buckets.0.Name'
Use Token.asXxx
to encode the returned Reference
as a specific type or
use the convenience getDataString
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.
dataPath
- the path to the data. This parameter is required.public IPrincipal getGrantPrincipal()
getGrantPrincipal
in interface IGrantable