Interface IAwsSdkCall
An AWS SDK call.
Namespace: Amazon.CDK.CustomResources
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IAwsSdkCall
Syntax (vb)
Public Interface IAwsSdkCall
Examples
new AwsCustomResource(this, "GetParameterCustomResource", new AwsCustomResourceProps {
OnUpdate = new AwsSdkCall { // will also be called for a CREATE event
Service = "SSM",
Action = "getParameter",
Parameters = new Dictionary<string, object> {
{ "Name", "my-parameter" },
{ "WithDecryption", true }
},
PhysicalResourceId = PhysicalResourceId.FromResponse("Parameter.ARN") },
Policy = AwsCustomResourcePolicy.FromSdkCalls(new SdkCallsPolicyOptions {
Resources = AwsCustomResourcePolicy.ANY_RESOURCE
})
});
Synopsis
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. |
IgnoreErrorCodesMatching | The regex pattern to use to catch API errors. |
Logging | A property used to configure logging during lambda function execution. |
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. |
Properties
Action
The service action to call.
string Action { get; }
Property Value
System.String
Remarks
This is the name of an AWS API call, in one of the following forms:
See: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html
ApiVersion
API version to use for the service.
virtual string ApiVersion { get; }
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.
virtual string AssumedRoleArn { get; }
Property Value
System.String
Remarks
Can be used primarily for cross-account requests to for example connect hostedzone with a shared vpc. Region controls where assumeRole call is made.
Example for Route53 / associateVPCWithHostedZone
Default: - run without assuming role
IgnoreErrorCodesMatching
The regex pattern to use to catch API errors.
virtual string IgnoreErrorCodesMatching { get; }
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
Logging
A property used to configure logging during lambda function execution.
virtual Logging Logging { get; }
Property Value
Remarks
Note: The default Logging configuration is all. This configuration will enable logging on all logged data in the lambda handler. This includes:
Default: Logging.all()
OutputPaths
Restrict the data returned by the custom resource to specific paths in the API response.
virtual string[] OutputPaths { get; }
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.
virtual object Parameters { get; }
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.
virtual PhysicalResourceId PhysicalResourceId { get; }
Property Value
Remarks
Mandatory for onCreate call. In onUpdate, you can omit this to passthrough it from request.
Default: - no physical resource id
Region
The region to send service requests to.
virtual string Region { get; }
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.
string Service { get; }
Property Value
System.String
Remarks
This is the name of an AWS service, in one of the following forms:
See: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html