Class AwsSdkCall
An AWS SDK call.
Inheritance
Implements
Namespace: Amazon.CDK.CustomResources
Assembly: Amazon.CDK.AWS.CustomResources.dll
Syntax (csharp)
public class AwsSdkCall : Object, IAwsSdkCall
Syntax (vb)
Public Class AwsSdkCall
Inherits Object
Implements IAwsSdkCall
Remarks
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
AwsSdkCall() |
Properties
Action | The service action to call. |
ApiVersion | API version to use for the service. |
AssumedRoleArn | Used for running the SDK calls in underlying lambda with a different role Can be used primarily for cross-account requests to for example connect hostedzone with a shared vpc. |
IgnoreErrorCodesMatching | The regex pattern to use to catch API errors. |
OutputPath | (deprecated) Restrict the data returned by the custom resource to a specific path in the API response. |
OutputPaths | Restrict the data returned by the custom resource to specific paths in the API response. |
Parameters | The parameters for the service action. |
PhysicalResourceId | The physical resource id of the custom resource for this call. |
Region | The region to send service requests to. |
Service | The service to call. |
Constructors
AwsSdkCall()
public AwsSdkCall()
Properties
Action
The service action to call.
public string Action { get; set; }
Property Value
System.String
Remarks
ApiVersion
API version to use for the service.
public string ApiVersion { get; set; }
Property Value
System.String
Remarks
Default: - use latest available API version
See: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/locking-api-versions.html
AssumedRoleArn
Used for running the SDK calls in underlying lambda with a different role Can be used primarily for cross-account requests to for example connect hostedzone with a shared vpc.
public string AssumedRoleArn { get; set; }
Property Value
System.String
Remarks
Example for Route53 / associateVPCWithHostedZone
Default: - run without assuming role
IgnoreErrorCodesMatching
The regex pattern to use to catch API errors.
public string IgnoreErrorCodesMatching { get; set; }
Property Value
System.String
Remarks
The code
property of the
Error
object will be tested against this pattern. If there is a match an
error will not be thrown.
Default: - do not catch errors
OutputPath
(deprecated) Restrict the data returned by the custom resource to a specific path in the API response.
public string OutputPath { get; set; }
Property Value
System.String
Remarks
Use this to limit the data returned by the custom resource if working with API calls that could potentially result in custom response objects exceeding the hard limit of 4096 bytes.
Example for ECS / updateService: 'service.deploymentConfiguration.maximumPercent'
Default: - return all data
Stability: Deprecated
OutputPaths
Restrict the data returned by the custom resource to specific paths in the API response.
public string[] OutputPaths { get; set; }
Property Value
System.String[]
Remarks
Use this to limit the data returned by the custom resource if working with API calls that could potentially result in custom response objects exceeding the hard limit of 4096 bytes.
Example for ECS / updateService: ['service.deploymentConfiguration.maximumPercent']
Default: - return all data
Parameters
The parameters for the service action.
public object Parameters { get; set; }
Property Value
System.Object
Remarks
Default: - no parameters
See: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html
PhysicalResourceId
The physical resource id of the custom resource for this call.
public PhysicalResourceId PhysicalResourceId { get; set; }
Property Value
Remarks
Mandatory for onCreate or onUpdate calls.
Default: - no physical resource id
Region
The region to send service requests to.
public string Region { get; set; }
Property Value
System.String
Remarks
Note: Cross-region operations are generally considered an anti-pattern. Consider first deploying a stack in that region.
Default: - the region where this custom resource is deployed
Service
The service to call.
public string Service { get; set; }
Property Value
System.String