interface AwsApiProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Events.Targets.AwsApiProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#AwsApiProps |
Java | software.amazon.awscdk.services.events.targets.AwsApiProps |
Python | aws_cdk.aws_events_targets.AwsApiProps |
TypeScript (source) | aws-cdk-lib » aws_events_targets » AwsApiProps |
Implements
Aws
Properties for an AwsApi target.
Example
const rule = new events.Rule(this, 'Rule', {
schedule: events.Schedule.rate(Duration.hours(1)),
});
rule.addTarget(new targets.AwsApi({
service: 'ECS',
action: 'updateService',
parameters: {
service: 'my-service',
forceNewDeployment: true,
},
}));
Properties
| Name | Type | Description |
|---|---|---|
| action | string | The service action to call. |
| service | string | The service to call. |
| api | string | API version to use for the service. |
| catch | string | The regex pattern to use to catch API errors. |
| parameters? | any | The parameters for the service action. |
| policy | Policy | The IAM policy statement to allow the API call. |
action
Type:
string
The service action to call.
See also: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html
service
Type:
string
The service to call.
See also: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html
apiVersion?
⚠️ Deprecated: the handler code was migrated to AWS SDK for JavaScript v3, which does not support this feature anymore
Type:
string
(optional)
API version to use for the service.
catchErrorPattern?
Type:
string
(optional, default: do not catch errors)
The regex pattern to use to catch API 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.
parameters?
Type:
any
(optional, default: no parameters)
The parameters for the service action.
See also: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html
policyStatement?
Type:
Policy
(optional, default: extract the permission from the API call)
The IAM policy statement to allow the API call.
Use only if resource restriction is needed.

.NET
Go
Java
Python
TypeScript (