Skip to content
v2.278.0

AlternateTargetOptions Struct ​

Options for AlternateTarget configuration.

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,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs
from aws_cdk import aws_iam as iam

# listener_rule_configuration: ecs.ListenerRuleConfiguration
# role: iam.Role

alternate_target_options = ecs.AlternateTargetOptions(
    role=role,
    test_listener=listener_rule_configuration
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;
import software.amazon.awscdk.services.iam.*;

ListenerRuleConfiguration listenerRuleConfiguration;
Role role;

AlternateTargetOptions alternateTargetOptions = AlternateTargetOptions.builder()
        .role(role)
        .testListener(listenerRuleConfiguration)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.IAM;

ListenerRuleConfiguration listenerRuleConfiguration;
Role role;

var alternateTargetOptions = new AlternateTargetOptions {
    Role = role,
    TestListener = listenerRuleConfiguration
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var listenerRuleConfiguration ListenerRuleConfiguration
var role Role

alternateTargetOptions := &AlternateTargetOptions{
	Role: role,
	TestListener: listenerRuleConfiguration,
}

Properties ​

roleoptionalIRoleroleoptionalIRoleroleoptionalIRoleRoleoptionalIRoleRoleoptionalIRole #
The IAM role for the configuration.

Default: a new role will be created

testListeneroptionalListenerRuleConfigurationtest_listeneroptionalListenerRuleConfigurationtestListeneroptionalListenerRuleConfigurationTestListeneroptionalListenerRuleConfigurationTestListeneroptionalListenerRuleConfiguration = none #
The test listener configuration.