aws-cdk-lib.aws_events_targets.AwsApiProps

interface AwsApiProps

LanguageType name
.NETAmazon.CDK.AWS.Events.Targets.AwsApiProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#AwsApiProps
Javasoftware.amazon.awscdk.services.events.targets.AwsApiProps
Pythonaws_cdk.aws_events_targets.AwsApiProps
TypeScript (source)aws-cdk-lib » aws_events_targets » AwsApiProps

Properties for an AwsApi target.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_events_targets as events_targets } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const parameters: any;
declare const policyStatement: iam.PolicyStatement;
const awsApiProps: events_targets.AwsApiProps = {
  action: 'action',
  service: 'service',

  // the properties below are optional
  apiVersion: 'apiVersion',
  catchErrorPattern: 'catchErrorPattern',
  parameters: parameters,
  policyStatement: policyStatement,
};

Properties

NameTypeDescription
actionstringThe service action to call.
servicestringThe service to call.
apiVersion?stringAPI version to use for the service.
catchErrorPattern?stringThe regex pattern to use to catch API errors.
parameters?anyThe parameters for the service action.
policyStatement?PolicyStatementThe 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?

Type: string (optional, default: use latest available API version)

API version to use for the service.

See also: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/locking-api-versions.html


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: PolicyStatement (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.