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.

  • 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 call

  • action (str) – The service action to call.

  • service (str) – The service to call.

  • api_version (Optional[str]) – API version to use for the service. Default: - use latest available API version

  • catch_error_pattern (Optional[str]) – 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. Default: - do not catch errors

  • parameters (Optional[Any]) – The parameters for the service action. Default: - no parameters


bind(rule, id=None)

Returns a RuleTarget that can be used to trigger this AwsApi as a result from an EventBridge event.

  • rule (IRule) –

  • id (Optional[str]) –

Return type