interface ApiDestinationProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Events.Targets.ApiDestinationProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#ApiDestinationProps |
Java | software.amazon.awscdk.services.events.targets.ApiDestinationProps |
Python | aws_cdk.aws_events_targets.ApiDestinationProps |
TypeScript (source) | aws-cdk-lib » aws_events_targets » ApiDestinationProps |
Customize the EventBridge Api Destinations Target.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_events as events } from 'aws-cdk-lib';
import { aws_events_targets as events_targets } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_sqs as sqs } from 'aws-cdk-lib';
declare const queue: sqs.Queue;
declare const role: iam.Role;
declare const ruleTargetInput: events.RuleTargetInput;
const apiDestinationProps: events_targets.ApiDestinationProps = {
deadLetterQueue: queue,
event: ruleTargetInput,
eventRole: role,
headerParameters: {
headerParametersKey: 'headerParameters',
},
maxEventAge: cdk.Duration.minutes(30),
pathParameterValues: ['pathParameterValues'],
queryStringParameters: {
queryStringParametersKey: 'queryStringParameters',
},
retryAttempts: 123,
};
Properties
Name | Type | Description |
---|---|---|
dead | IQueue | The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue. |
event? | Rule | The event to send. |
event | IRole | The role to assume before invoking the target. |
header | { [string]: string } | Additional headers sent to the API Destination. |
max | Duration | The maximum age of a request that Lambda sends to a function for processing. |
path | string[] | Path parameters to insert in place of path wildcards (* ). |
query | { [string]: string } | Additional query string parameters sent to the API Destination. |
retry | number | The maximum number of times to retry when the function returns an error. |
deadLetterQueue?
Type:
IQueue
(optional, default: no dead-letter queue)
The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.
The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
event?
Type:
Rule
(optional, default: the entire EventBridge event)
The event to send.
eventRole?
Type:
IRole
(optional, default: a new role will be created)
The role to assume before invoking the target.
headerParameters?
Type:
{ [string]: string }
(optional, default: none)
Additional headers sent to the API Destination.
These are merged with headers specified on the Connection, with the headers on the Connection taking precedence.
You can only specify secret values on the Connection.
maxEventAge?
Type:
Duration
(optional, default: Duration.hours(24))
The maximum age of a request that Lambda sends to a function for processing.
Minimum value of 60. Maximum value of 86400.
pathParameterValues?
Type:
string[]
(optional, default: none)
Path parameters to insert in place of path wildcards (*
).
If the API destination has a wilcard in the path, these path parts will be inserted in that place.
queryStringParameters?
Type:
{ [string]: string }
(optional, default: none)
Additional query string parameters sent to the API Destination.
These are merged with headers specified on the Connection, with the headers on the Connection taking precedence.
You can only specify secret values on the Connection.
retryAttempts?
Type:
number
(optional, default: 185)
The maximum number of times to retry when the function returns an error.
Minimum value of 0. Maximum value of 185.