class ApiDestination
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Events.Targets.ApiDestination |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#ApiDestination |
Java | software.amazon.awscdk.services.events.targets.ApiDestination |
Python | aws_cdk.aws_events_targets.ApiDestination |
TypeScript (source) | aws-cdk-lib » aws_events_targets » ApiDestination |
Implements
IRule
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
IApi
Destination - props
Api
Destination Props
Methods
Name | Description |
---|---|
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
Returns a RuleTarget that can be used to trigger API destinations from an EventBridge event.