# AlternateTargetOptions

Options for AlternateTarget configuration.

- Source: [`aws-ecs/lib/alternate-target-configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ecs/lib/alternate-target-configuration.ts#L94)
- Type last changed: v2.211.0 · 13 Aug 2025

## Example

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

declare const listenerRuleConfiguration: ecs.ListenerRuleConfiguration;
declare const role: iam.Role;
const alternateTargetOptions: ecs.AlternateTargetOptions = {
  role: role,
  testListener: listenerRuleConfiguration,
};
```

## Properties

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The IAM role for the configuration.

  **Default:** a new role will be created

- `testListener`: [ListenerRuleConfiguration](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ListenerRuleConfiguration.html) = none — The test listener configuration.
