Class NetworkListenerAction
What to do when a client makes a request to a listener.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class NetworkListenerAction : DeputyBase, IListenerAction
Syntax (vb)
Public Class NetworkListenerAction
Inherits DeputyBase
Implements IListenerAction
Remarks
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.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.ElasticLoadBalancingV2;
NetworkTargetGroup networkTargetGroup;
var networkListenerAction = NetworkListenerAction.Forward(new [] { networkTargetGroup }, new NetworkForwardOptions {
StickinessDuration = Duration.Minutes(30)
});
Synopsis
Constructors
NetworkListenerAction(CfnListener.IActionProperty, NetworkListenerAction) | Create an instance of NetworkListenerAction. |
NetworkListenerAction(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
NetworkListenerAction(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
Next |
Methods
Bind(Construct, INetworkListener) | Called when the action is being used in a listener. |
Forward(INetworkTargetGroup[], INetworkForwardOptions) | Forward to one or more Target Groups. |
RenderActions() | Render the listener default actions in this chain. |
RenderRuleActions() | Render the listener rule actions in this chain. |
Renumber(CfnListener.IActionProperty[]) | Renumber the "order" fields in the actions array. |
WeightedForward(INetworkWeightedTargetGroup[], INetworkForwardOptions) | Forward to one or more Target Groups which are weighted differently. |
Constructors
NetworkListenerAction(CfnListener.IActionProperty, NetworkListenerAction)
Create an instance of NetworkListenerAction.
public NetworkListenerAction(CfnListener.IActionProperty defaultActionJson, NetworkListenerAction next = null)
Parameters
- defaultActionJson CfnListener.IActionProperty
- next NetworkListenerAction
Remarks
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.
NetworkListenerAction(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected NetworkListenerAction(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
NetworkListenerAction(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected NetworkListenerAction(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
Next
Methods
Bind(Construct, INetworkListener)
Called when the action is being used in a listener.
public virtual void Bind(Construct scope, INetworkListener listener)
Parameters
- scope Constructs.Construct
- listener INetworkListener
Forward(INetworkTargetGroup[], INetworkForwardOptions)
Forward to one or more Target Groups.
public static NetworkListenerAction Forward(INetworkTargetGroup[] targetGroups, INetworkForwardOptions options = null)
Parameters
- targetGroups INetworkTargetGroup[]
- options INetworkForwardOptions
Returns
RenderActions()
Render the listener default actions in this chain.
public virtual CfnListener.IActionProperty[] RenderActions()
Returns
RenderRuleActions()
Render the listener rule actions in this chain.
public virtual CfnListenerRule.IActionProperty[] RenderRuleActions()
Returns
CfnListenerRule.IActionProperty[]
Renumber(CfnListener.IActionProperty[])
Renumber the "order" fields in the actions array.
protected virtual CfnListener.IActionProperty[] Renumber(CfnListener.IActionProperty[] actions)
Parameters
- actions CfnListener.IActionProperty[]
Returns
Remarks
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
.
WeightedForward(INetworkWeightedTargetGroup[], INetworkForwardOptions)
Forward to one or more Target Groups which are weighted differently.
public static NetworkListenerAction WeightedForward(INetworkWeightedTargetGroup[] targetGroups, INetworkForwardOptions options = null)
Parameters
- targetGroups INetworkWeightedTargetGroup[]
- options INetworkForwardOptions
Returns