Class ListenerConfig
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ecs.ListenerConfig
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-06T23:25:09.430Z")
@Stability(Stable)
public abstract class ListenerConfig
extends software.amazon.jsii.JsiiObject
Base class for configuring listener when registering targets.
Example:
Cluster cluster;
TaskDefinition taskDefinition;
Vpc vpc;
FargateService service = FargateService.Builder.create(this, "Service").cluster(cluster).taskDefinition(taskDefinition).build();
ApplicationLoadBalancer lb = ApplicationLoadBalancer.Builder.create(this, "LB").vpc(vpc).internetFacing(true).build();
ApplicationListener listener = lb.addListener("Listener", BaseApplicationListenerProps.builder().port(80).build());
service.registerLoadBalancerTargets(EcsTarget.builder()
.containerName("web")
.containerPort(80)
.newTargetGroupId("ECS")
.listener(ListenerConfig.applicationListener(listener, AddApplicationTargetsProps.builder()
.protocol(ApplicationProtocol.HTTPS)
.build()))
.build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedListenerConfig(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedListenerConfig(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddTargets(String id, LoadBalancerTargetOptions target, BaseService service) Create and attach a target group to listener.static ListenerConfigapplicationListener(ApplicationListener listener) Create a config for adding target group to ALB listener.static ListenerConfigapplicationListener(ApplicationListener listener, AddApplicationTargetsProps props) Create a config for adding target group to ALB listener.static ListenerConfignetworkListener(NetworkListener listener) Create a config for adding target group to NLB listener.static ListenerConfignetworkListener(NetworkListener listener, AddNetworkTargetsProps props) Create a config for adding target group to NLB listener.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ListenerConfig
protected ListenerConfig(software.amazon.jsii.JsiiObjectRef objRef) -
ListenerConfig
protected ListenerConfig(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ListenerConfig
@Stability(Stable) protected ListenerConfig()
-
-
Method Details
-
applicationListener
@Stability(Stable) @NotNull public static ListenerConfig applicationListener(@NotNull ApplicationListener listener, @Nullable AddApplicationTargetsProps props) Create a config for adding target group to ALB listener.- Parameters:
listener- This parameter is required.props-
-
applicationListener
@Stability(Stable) @NotNull public static ListenerConfig applicationListener(@NotNull ApplicationListener listener) Create a config for adding target group to ALB listener.- Parameters:
listener- This parameter is required.
-
networkListener
@Stability(Stable) @NotNull public static ListenerConfig networkListener(@NotNull NetworkListener listener, @Nullable AddNetworkTargetsProps props) Create a config for adding target group to NLB listener.- Parameters:
listener- This parameter is required.props-
-
networkListener
@Stability(Stable) @NotNull public static ListenerConfig networkListener(@NotNull NetworkListener listener) Create a config for adding target group to NLB listener.- Parameters:
listener- This parameter is required.
-
addTargets
@Stability(Stable) public abstract void addTargets(@NotNull String id, @NotNull LoadBalancerTargetOptions target, @NotNull BaseService service) Create and attach a target group to listener.- Parameters:
id- This parameter is required.target- This parameter is required.service- This parameter is required.
-