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.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.413Z")
@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
ModifierConstructorDescriptionprotected
protected
ListenerConfig
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
ListenerConfig
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
addTargets
(String id, LoadBalancerTargetOptions target, BaseService service) Create and attach a target group to listener.static ListenerConfig
applicationListener
(ApplicationListener listener) Create a config for adding target group to ALB listener.static ListenerConfig
applicationListener
(ApplicationListener listener, AddApplicationTargetsProps props) Create a config for adding target group to ALB listener.static ListenerConfig
networkListener
(NetworkListener listener) Create a config for adding target group to NLB listener.static ListenerConfig
networkListener
(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, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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.
-