interface RuleTargetConfig
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Events.RuleTargetConfig |
Java | software.amazon.awscdk.services.events.RuleTargetConfig |
Python | aws_cdk.aws_events.RuleTargetConfig |
TypeScript (source) | @aws-cdk/aws-events » RuleTargetConfig |
Obtainable from
Api
.bind()
, Api
.bind()
, Aws
.bind()
, Batch
.bind()
, Cloud
.bind()
, Code
.bind()
, Code
.bind()
, Ecs
.bind()
, Event
.bind()
, Kinesis
.bind()
, Kinesis
.bind()
, Lambda
.bind()
, Sfn
.bind()
, Sns
.bind()
, Sqs
.bind()
Properties for an event rule target.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as events from '@aws-cdk/aws-events';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
declare const construct: cdk.Construct;
declare const role: iam.Role;
declare const ruleTargetInput: events.RuleTargetInput;
const ruleTargetConfig: events.RuleTargetConfig = {
arn: 'arn',
// the properties below are optional
batchParameters: {
jobDefinition: 'jobDefinition',
jobName: 'jobName',
// the properties below are optional
arrayProperties: {
size: 123,
},
retryStrategy: {
attempts: 123,
},
},
deadLetterConfig: {
arn: 'arn',
},
ecsParameters: {
taskDefinitionArn: 'taskDefinitionArn',
// the properties below are optional
capacityProviderStrategy: [{
capacityProvider: 'capacityProvider',
// the properties below are optional
base: 123,
weight: 123,
}],
enableEcsManagedTags: false,
enableExecuteCommand: false,
group: 'group',
launchType: 'launchType',
networkConfiguration: {
awsVpcConfiguration: {
subnets: ['subnets'],
// the properties below are optional
assignPublicIp: 'assignPublicIp',
securityGroups: ['securityGroups'],
},
},
placementConstraints: [{
expression: 'expression',
type: 'type',
}],
placementStrategies: [{
field: 'field',
type: 'type',
}],
platformVersion: 'platformVersion',
propagateTags: 'propagateTags',
referenceId: 'referenceId',
tagList: [{
key: 'key',
value: 'value',
}],
taskCount: 123,
},
httpParameters: {
headerParameters: {
headerParametersKey: 'headerParameters',
},
pathParameterValues: ['pathParameterValues'],
queryStringParameters: {
queryStringParametersKey: 'queryStringParameters',
},
},
id: 'id',
input: ruleTargetInput,
kinesisParameters: {
partitionKeyPath: 'partitionKeyPath',
},
retryPolicy: {
maximumEventAgeInSeconds: 123,
maximumRetryAttempts: 123,
},
role: role,
runCommandParameters: {
runCommandTargets: [{
key: 'key',
values: ['values'],
}],
},
sqsParameters: {
messageGroupId: 'messageGroupId',
},
targetResource: construct,
};
Properties
Name | Type | Description |
---|---|---|
arn | string | The Amazon Resource Name (ARN) of the target. |
batch | Batch | Parameters used when the rule invokes Amazon AWS Batch Job/Queue. |
dead | Dead | Contains information about a dead-letter queue configuration. |
ecs | Ecs | The Amazon ECS task definition and task count to use, if the event target is an Amazon ECS task. |
http | Http | Contains the HTTP parameters to use when the target is a API Gateway REST endpoint or EventBridge API destination. |
id? | string | A unique, user-defined identifier for the target. |
input? | Rule | What input to send to the event target. |
kinesis | Kinesis | Settings that control shard assignment, when the target is a Kinesis stream. |
retry | Retry | A RetryPolicy object that includes information about the retry policy settings. |
role? | IRole | Role to use to invoke this event target. |
run | Run | Parameters used when the rule invokes Amazon EC2 Systems Manager Run Command. |
sqs | Sqs | Parameters used when the FIFO sqs queue is used an event target by the rule. |
target | IConstruct | The resource that is backing this target. |
arn
Type:
string
The Amazon Resource Name (ARN) of the target.
batchParameters?
Type:
Batch
(optional, default: no parameters set)
Parameters used when the rule invokes Amazon AWS Batch Job/Queue.
deadLetterConfig?
Type:
Dead
(optional, default: no dead-letter queue set)
Contains information about a dead-letter queue configuration.
ecsParameters?
Type:
Ecs
(optional)
The Amazon ECS task definition and task count to use, if the event target is an Amazon ECS task.
httpParameters?
Type:
Http
(optional, default: None)
Contains the HTTP parameters to use when the target is a API Gateway REST endpoint or EventBridge API destination.
id?
⚠️ Deprecated: no replacement. we will always use an autogenerated id.
Type:
string
(optional, default: an auto-generated id)
A unique, user-defined identifier for the target.
Acceptable values include alphanumeric characters, periods (.), hyphens (-), and underscores (_).
input?
Type:
Rule
(optional, default: the entire event)
What input to send to the event target.
kinesisParameters?
Type:
Kinesis
(optional)
Settings that control shard assignment, when the target is a Kinesis stream.
If you don't include this parameter, eventId is used as the partition key.
retryPolicy?
Type:
Retry
(optional, default: EventBridge default retry policy)
A RetryPolicy object that includes information about the retry policy settings.
role?
Type:
IRole
(optional)
Role to use to invoke this event target.
runCommandParameters?
Type:
Run
(optional)
Parameters used when the rule invokes Amazon EC2 Systems Manager Run Command.
sqsParameters?
Type:
Sqs
(optional)
Parameters used when the FIFO sqs queue is used an event target by the rule.
targetResource?
Type:
IConstruct
(optional, default: the target is not backed by any resource)
The resource that is backing this target.
This is the resource that will actually have some action performed on it when used as a target (for example, start a build for a CodeBuild project). We need it to determine whether the rule belongs to a different account than the target - if so, we generate a more complex setup, including an additional stack containing the EventBusPolicy.