# RuleTargetConfig

Properties for an event rule target.

- Source: [`aws-events/lib/target.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-events/lib/target.ts#L24)
- Type last changed: v2.156.0 · 6 Sep 2024

## Example

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

declare const construct: constructs.Construct;
declare const role: iam.Role;
declare const ruleTargetInput: events.RuleTargetInput;
const ruleTargetConfig: events.RuleTargetConfig = {
  arn: 'arn',

  // the properties below are optional
  appSyncParameters: {
    graphQlOperation: 'graphQlOperation',
  },
  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',
    },
  },
  input: ruleTargetInput,
  kinesisParameters: {
    partitionKeyPath: 'partitionKeyPath',
  },
  redshiftDataParameters: {
    database: 'database',

    // the properties below are optional
    dbUser: 'dbUser',
    secretManagerArn: 'secretManagerArn',
    sql: 'sql',
    sqls: ['sqls'],
    statementName: 'statementName',
    withEvent: false,
  },
  retryPolicy: {
    maximumEventAgeInSeconds: 123,
    maximumRetryAttempts: 123,
  },
  role: role,
  runCommandParameters: {
    runCommandTargets: [{
      key: 'key',
      values: ['values'],
    }],
  },
  sqsParameters: {
    messageGroupId: 'messageGroupId',
  },
  targetResource: construct,
};
```

## Properties

- `appSyncParameters`: [CfnRule.AppSyncParametersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.AppSyncParametersProperty.html) = None — Contains the GraphQL operation to be parsed and executed, if the event target is an AWS AppSync API.

- `arn`: string (required) — The Amazon Resource Name (ARN) of the target.

- `batchParameters`: [CfnRule.BatchParametersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.BatchParametersProperty.html) — Parameters used when the rule invokes Amazon AWS Batch Job/Queue.

  **Default:** no parameters set

- `deadLetterConfig`: [CfnRule.DeadLetterConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.DeadLetterConfigProperty.html) — Contains information about a dead-letter queue configuration.

  **Default:** no dead-letter queue set

- `ecsParameters`: [CfnRule.EcsParametersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.EcsParametersProperty.html) — The Amazon ECS task definition and task count to use, if the event target is an Amazon ECS task.

- `httpParameters`: [CfnRule.HttpParametersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.HttpParametersProperty.html) = None — Contains the HTTP parameters to use when the target is a API Gateway REST endpoint or EventBridge API destination.

- `input`: [RuleTargetInput](/cdk/api/v2/docs/aws-cdk-lib.aws_events.RuleTargetInput.html) — What input to send to the event target.

  **Default:** the entire event

- `kinesisParameters`: [CfnRule.KinesisParametersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.KinesisParametersProperty.html) — 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.

- `redshiftDataParameters`: [CfnRule.RedshiftDataParametersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.RedshiftDataParametersProperty.html) — Parameters used when the rule invokes Amazon Redshift Queries.

  **Default:** no parameters set

- `retryPolicy`: [CfnRule.RetryPolicyProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.RetryPolicyProperty.html) — A RetryPolicy object that includes information about the retry policy settings.

  **Default:** EventBridge default retry policy

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — Role to use to invoke this event target.

- `runCommandParameters`: [CfnRule.RunCommandParametersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.RunCommandParametersProperty.html) — Parameters used when the rule invokes Amazon EC2 Systems Manager Run Command.

- `sqsParameters`: [CfnRule.SqsParametersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_events.CfnRule.SqsParametersProperty.html) — Parameters used when the FIFO sqs queue is used an event target by the rule.

- `targetResource`: [IConstruct](/cdk/api/v2/docs/constructs.IConstruct.html) — The resource that is backing this target.

  **Default:** the target is not backed by any resource

  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.
