aws-cdk-lib.aws_events_targets.ApiDestination

class ApiDestination

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

Implements IRuleTarget

Use an API Destination rule target.

Example

const connection = new events.Connection(this, 'Connection', {
  authorization: events.Authorization.apiKey('x-api-key', SecretValue.secretsManager('ApiSecretName')),
  description: 'Connection with API Key x-api-key',
});

const destination = new events.ApiDestination(this, 'Destination', {
  connection,
  endpoint: 'https://example.com',
  description: 'Calling example.com with API key x-api-key',
});

const rule = new events.Rule(this, 'Rule', {
  schedule: events.Schedule.rate(Duration.minutes(1)),
  targets: [new targets.ApiDestination(destination)],
});

Initializer

new ApiDestination(apiDestination: IApiDestination, props?: ApiDestinationProps)

Parameters

  • apiDestination IApiDestination
  • props ApiDestinationProps

Methods

NameDescription
bind(_rule, _id?)Returns a RuleTarget that can be used to trigger API destinations from an EventBridge event.

bind(_rule, _id?)

public bind(_rule: IRule, _id?: string): RuleTargetConfig

Parameters

  • _rule IRule
  • _id string

Returns

  • RuleTargetConfig

Returns a RuleTarget that can be used to trigger API destinations from an EventBridge event.