AwsApi
- class aws_cdk.aws_events_targets.AwsApi(*, policy_statement=None, action, service, api_version=None, catch_error_pattern=None, parameters=None)
Bases:
object
Use an AWS Lambda function that makes API calls as an event rule target.
- ExampleMetadata:
infused
Example:
rule = events.Rule(self, "Rule", schedule=events.Schedule.rate(Duration.hours(1)) ) rule.add_target(targets.AwsApi( service="ECS", action="updateService", parameters={ "service": "my-service", "force_new_deployment": True } ))
- Parameters:
policy_statement (
Optional
[PolicyStatement
]) – The IAM policy statement to allow the API call. Use only if resource restriction is needed. Default: - extract the permission from the API callaction (
str
) – The service action to call.service (
str
) – The service to call.api_version (
Optional
[str
]) – (deprecated) API version to use for the service.catch_error_pattern (
Optional
[str
]) – The regex pattern to use to catch API errors. Thecode
property of theError
object will be tested against this pattern. If there is a match an error will not be thrown. Default: - do not catch errorsparameters (
Any
) – The parameters for the service action. Default: - no parameters
Methods