Show / Hide Table of Contents

Class ListenerAction

What to do when a client makes a request to a listener.

Inheritance
System.Object
ListenerAction
AuthenticateCognitoAction
Implements
IListenerAction
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.AWS.ElasticLoadBalancingV2.dll
Syntax (csharp)
public class ListenerAction : DeputyBase, IListenerAction
Syntax (vb)
Public Class ListenerAction
    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.

(Called ListenerAction instead of the more strictly correct ListenerAction because this is the class most users interact with, and we want to make it not too visually overwhelming).

Synopsis

Constructors

ListenerAction(CfnListener.IActionProperty, ListenerAction)

Create an instance of ListenerAction.

ListenerAction(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

ListenerAction(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Properties

Next

Methods

AuthenticateOidc(IAuthenticateOidcOptions)

Authenticate using an identity provider (IdP) that is compliant with OpenID Connect (OIDC).

Bind(Construct, IApplicationListener, IConstruct)

Called when the action is being used in a listener.

FixedResponse(Double, IFixedResponseOptions)

Return a fixed response.

Forward(IApplicationTargetGroup[], IForwardOptions)

Forward to one or more Target Groups.

Redirect(IRedirectOptions)

Redirect to a different URI.

RenderActions()

Render the actions in this chain.

Renumber(CfnListener.IActionProperty[])

Renumber the "order" fields in the actions array.

WeightedForward(IWeightedTargetGroup[], IForwardOptions)

Forward to one or more Target Groups which are weighted differently.

Constructors

ListenerAction(CfnListener.IActionProperty, ListenerAction)

Create an instance of ListenerAction.

public ListenerAction(CfnListener.IActionProperty actionJson, ListenerAction next = null)
Parameters
actionJson CfnListener.IActionProperty
next ListenerAction
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.

ListenerAction(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected ListenerAction(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

ListenerAction(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected ListenerAction(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Properties

Next

protected virtual ListenerAction Next { get; }
Property Value

ListenerAction

Methods

AuthenticateOidc(IAuthenticateOidcOptions)

Authenticate using an identity provider (IdP) that is compliant with OpenID Connect (OIDC).

public static ListenerAction AuthenticateOidc(IAuthenticateOidcOptions options)
Parameters
options IAuthenticateOidcOptions
Returns

ListenerAction

Remarks

See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-authenticate-users.html#oidc-requirements

Bind(Construct, IApplicationListener, IConstruct)

Called when the action is being used in a listener.

public virtual void Bind(Construct scope, IApplicationListener listener, IConstruct associatingConstruct = null)
Parameters
scope Construct
listener IApplicationListener
associatingConstruct IConstruct

FixedResponse(Double, IFixedResponseOptions)

Return a fixed response.

public static ListenerAction FixedResponse(double statusCode, IFixedResponseOptions options = null)
Parameters
statusCode System.Double
options IFixedResponseOptions
Returns

ListenerAction

Remarks

See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#fixed-response-actions

Forward(IApplicationTargetGroup[], IForwardOptions)

Forward to one or more Target Groups.

public static ListenerAction Forward(IApplicationTargetGroup[] targetGroups, IForwardOptions options = null)
Parameters
targetGroups IApplicationTargetGroup[]
options IForwardOptions
Returns

ListenerAction

Remarks

See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#forward-actions

Redirect(IRedirectOptions)

Redirect to a different URI.

public static ListenerAction Redirect(IRedirectOptions options)
Parameters
options IRedirectOptions
Returns

ListenerAction

Remarks

A URI consists of the following components: protocol://hostname:port/path?query. You must modify at least one of the following components to avoid a redirect loop: protocol, hostname, port, or path. Any components that you do not modify retain their original values.

You can reuse URI components using the following reserved keywords:

    For example, you can change the path to "/new/#{path}", the hostname to "example.#{host}", or the query to "#{query}&value=xyz".

    See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#redirect-actions

    RenderActions()

    Render the actions in this chain.

    public virtual CfnListener.IActionProperty[] RenderActions()
    Returns

    CfnListener.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

    CfnListener.IActionProperty[]

    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 ListenerAction instead of in Listener so that we give users the opportunity to override by subclassing and overriding renderActions.

    WeightedForward(IWeightedTargetGroup[], IForwardOptions)

    Forward to one or more Target Groups which are weighted differently.

    public static ListenerAction WeightedForward(IWeightedTargetGroup[] targetGroups, IForwardOptions options = null)
    Parameters
    targetGroups IWeightedTargetGroup[]
    options IForwardOptions
    Returns

    ListenerAction

    Remarks

    See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#forward-actions

    Implements

    IListenerAction
    Back to top Generated by DocFX