AwsSdkCall Struct
An AWS SDK call.
Example
new cr.AwsCustomResource(this, 'GetParameterCustomResource', {
onUpdate: { // will also be called for a CREATE event
service: 'SSM',
action: 'getParameter',
parameters: {
Name: 'my-parameter',
WithDecryption: true,
},
physicalResourceId: cr.PhysicalResourceId.fromResponse('Parameter.ARN'),
},
policy: cr.AwsCustomResourcePolicy.fromSdkCalls({
resources: cr.AwsCustomResourcePolicy.ANY_RESOURCE,
}),
});
Properties
notes
This is the name of an AWS API call, in one of the following forms:
- An API call name as found in the API Reference documentation (
GetObject) - The API call name starting with a lowercase letter (
getObject) - The AWS SDK for JavaScript v3 command class name (
GetObjectCommand)
apiVersionstringapi_versionstrapiVersionStringApiVersionstringApiVersion*string= use latest available API version#assumedRoleArnstringassumed_role_arnstrassumedRoleArnStringAssumedRoleArnstringAssumedRoleArn*string= run without assuming role#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
notes
This is an additional security measure that helps prevent the "confused deputy" problem where an entity that doesn't have permission to perform an action can coerce a more-privileged entity to perform the action.
The external ID must be provided by the third-party service and should not be generated by you. This value should be unique among the third-party service's customers.
This property is only used when assumedRoleArn is specified.
ignoreErrorCodesMatchingstringignore_error_codes_matchingstrignoreErrorCodesMatchingStringIgnoreErrorCodesMatchingstringIgnoreErrorCodesMatching*string= do not catch errors#The code property of the Error object will be tested against this pattern. If there is a match an error will not be thrown.
notes
Note: The default Logging configuration is all. This configuration will enable logging on all logged data in the lambda handler. This includes:
- The event object that is received by the lambda handler
- The response received after making a API call
- The response object that the lambda handler will return
- SDK versioning information
- Caught and uncaught errors
outputPathsstring[]output_pathstyping.List[str]outputPathsList<String>OutputPathsstring[]OutputPaths*[]*string= return all data#notes
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']
physicalResourceIdPhysicalResourceIdphysical_resource_idPhysicalResourceIdphysicalResourceIdPhysicalResourceIdPhysicalResourceIdPhysicalResourceIdPhysicalResourceIdPhysicalResourceId= no physical resource id#Mandatory for onCreate call. In onUpdate, you can omit this to passthrough it from request.
Note: Cross-region operations are generally considered an anti-pattern.Consider first deploying a stack in that region.
default
Default: the region where this custom resource is deployed
notes
This is the name of an AWS service, in one of the following forms:
- An AWS SDK for JavaScript v3 package name (
@aws-sdk/client-api-gateway) - An AWS SDK for JavaScript v3 client name (
api-gateway) - An AWS SDK for JavaScript v2 constructor name (
APIGateway) - A lowercase AWS SDK for JavaScript v2 constructor name (
apigateway)