Class AwsCustomResource
Defines a custom resource that is materialized using specific AWS API calls.
Inherited Members
Namespace: Amazon.CDK.CustomResources
Assembly: Amazon.CDK.AWS.CustomResources.dll
Syntax (csharp)
public class AwsCustomResource : Construct, IConstruct, IDependable, IGrantable
Syntax (vb)
Public Class AwsCustomResource
Inherits Construct
Implements IConstruct, IDependable, IGrantable
Remarks
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.
ExampleMetadata: infused
Examples
var awsCustom = new AwsCustomResource(this, "aws-custom", new AwsCustomResourceProps {
OnCreate = new AwsSdkCall {
Service = "...",
Action = "...",
Parameters = new Dictionary<string, string> {
{ "text", "..." }
},
PhysicalResourceId = PhysicalResourceId.Of("...")
},
OnUpdate = new AwsSdkCall {
Service = "...",
Action = "...",
Parameters = new Dictionary<string, object> {
{ "text", "..." },
{ "resourceId", new PhysicalResourceIdReference() }
}
},
Policy = AwsCustomResourcePolicy.FromSdkCalls(new SdkCallsPolicyOptions {
Resources = AwsCustomResourcePolicy.ANY_RESOURCE
})
});
Synopsis
Constructors
AwsCustomResource(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
AwsCustomResource(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
AwsCustomResource(Construct, String, IAwsCustomResourceProps) |
Properties
GrantPrincipal | The principal to grant permissions to. |
Methods
GetResponseField(String) | Returns response data for the AWS SDK call as string. |
GetResponseFieldReference(String) | Returns response data for the AWS SDK call. |
Constructors
AwsCustomResource(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected AwsCustomResource(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
AwsCustomResource(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected AwsCustomResource(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
AwsCustomResource(Construct, String, IAwsCustomResourceProps)
public AwsCustomResource(Construct scope, string id, IAwsCustomResourceProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IAwsCustomResourceProps
Properties
GrantPrincipal
The principal to grant permissions to.
public virtual IPrincipal GrantPrincipal { get; }
Property Value
Methods
GetResponseField(String)
Returns response data for the AWS SDK call as string.
public virtual string GetResponseField(string dataPath)
Parameters
- dataPath System.String
the path to the data.
Returns
System.String
Remarks
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.
GetResponseFieldReference(String)
Returns response data for the AWS SDK call.
public virtual Reference GetResponseFieldReference(string dataPath)
Parameters
- dataPath System.String
the path to the data.
Returns
Remarks
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.