@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:57.677Z") public class NetworkListenerAction extends software.amazon.jsii.JsiiObject implements IListenerAction
Some actions can be combined with other ones (specifically, you can perform authentication before serving the request).
Multiple actions form a linked chain; the chain must always terminate in a (weighted)forward, fixedResponse or redirect action.
If an action supports chaining, the next action can be indicated
by passing it in the next
property.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.elasticloadbalancingv2.*; import software.amazon.awscdk.core.*; NetworkTargetGroup networkTargetGroup; NetworkListenerAction networkListenerAction = NetworkListenerAction.forward(List.of(networkTargetGroup), NetworkForwardOptions.builder() .stickinessDuration(Duration.minutes(30)) .build());
IListenerAction.Jsii$Default, IListenerAction.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
NetworkListenerAction(CfnListener.ActionProperty actionJson,
NetworkListenerAction next)
Create an instance of NetworkListenerAction.
|
protected |
NetworkListenerAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
NetworkListenerAction(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
void |
bind(Construct scope,
INetworkListener listener)
Called when the action is being used in a listener.
|
static NetworkListenerAction |
forward(java.util.List<? extends INetworkTargetGroup> targetGroups)
Forward to one or more Target Groups.
|
static NetworkListenerAction |
forward(java.util.List<? extends INetworkTargetGroup> targetGroups,
NetworkForwardOptions options)
Forward to one or more Target Groups.
|
protected NetworkListenerAction |
getNext() |
java.util.List<CfnListener.ActionProperty> |
renderActions()
Render the actions in this chain.
|
protected java.util.List<CfnListener.ActionProperty> |
renumber(java.util.List<CfnListener.ActionProperty> actions)
Renumber the "order" fields in the actions array.
|
static NetworkListenerAction |
weightedForward(java.util.List<? extends NetworkWeightedTargetGroup> targetGroups)
Forward to one or more Target Groups which are weighted differently.
|
static NetworkListenerAction |
weightedForward(java.util.List<? extends NetworkWeightedTargetGroup> targetGroups,
NetworkForwardOptions options)
Forward to one or more Target Groups which are weighted differently.
|
protected NetworkListenerAction(software.amazon.jsii.JsiiObjectRef objRef)
protected NetworkListenerAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected NetworkListenerAction(CfnListener.ActionProperty actionJson, NetworkListenerAction next)
The default class should be good enough for most cases and should be created by using one of the static factory functions, but allow overriding to make sure we allow flexibility for the future.
actionJson
- This parameter is required.next
- public static NetworkListenerAction forward(java.util.List<? extends INetworkTargetGroup> targetGroups, NetworkForwardOptions options)
targetGroups
- This parameter is required.options
- public static NetworkListenerAction forward(java.util.List<? extends INetworkTargetGroup> targetGroups)
targetGroups
- This parameter is required.public static NetworkListenerAction weightedForward(java.util.List<? extends NetworkWeightedTargetGroup> targetGroups, NetworkForwardOptions options)
targetGroups
- This parameter is required.options
- public static NetworkListenerAction weightedForward(java.util.List<? extends NetworkWeightedTargetGroup> targetGroups)
targetGroups
- This parameter is required.public void bind(Construct scope, INetworkListener listener)
scope
- This parameter is required.listener
- This parameter is required.public java.util.List<CfnListener.ActionProperty> renderActions()
renderActions
in interface IListenerAction
protected java.util.List<CfnListener.ActionProperty> renumber(java.util.List<CfnListener.ActionProperty> actions)
We don't number for 0 or 1 elements, but otherwise number them 1...#actions so ELB knows about the right order.
Do this in NetworkListenerAction
instead of in Listener
so that we give
users the opportunity to override by subclassing and overriding renderActions
.
actions
- This parameter is required.protected NetworkListenerAction getNext()