Class ApplicationListenerRuleProps
Properties for defining a listener rule.
Inheritance
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.AWS.ElasticLoadBalancingV2.dll
Syntax (csharp)
public class ApplicationListenerRuleProps : Object, IApplicationListenerRuleProps, IBaseApplicationListenerRuleProps
Syntax (vb)
Public Class ApplicationListenerRuleProps
Inherits Object
Implements IApplicationListenerRuleProps, IBaseApplicationListenerRuleProps
Remarks
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.AWS.ElasticLoadBalancingV2;
ApplicationListener applicationListener;
ApplicationTargetGroup applicationTargetGroup;
ListenerAction listenerAction;
ListenerCondition listenerCondition;
var applicationListenerRuleProps = new ApplicationListenerRuleProps {
Listener = applicationListener,
Priority = 123,
// the properties below are optional
Action = listenerAction,
Conditions = new [] { listenerCondition },
FixedResponse = new FixedResponse {
StatusCode = "statusCode",
// the properties below are optional
ContentType = ContentType.TEXT_PLAIN,
MessageBody = "messageBody"
},
HostHeader = "hostHeader",
PathPattern = "pathPattern",
PathPatterns = new [] { "pathPatterns" },
RedirectResponse = new RedirectResponse {
StatusCode = "statusCode",
// the properties below are optional
Host = "host",
Path = "path",
Port = "port",
Protocol = "protocol",
Query = "query"
},
TargetGroups = new [] { applicationTargetGroup }
};
Synopsis
Constructors
ApplicationListenerRuleProps() |
Properties
Action | Action to perform when requests are received. |
Conditions | Rule applies if matches the conditions. |
FixedResponse | (deprecated) Fixed response to return. |
HostHeader | (deprecated) Rule applies if the requested host matches the indicated host. |
Listener | The listener to attach the rule to. |
PathPattern | (deprecated) Rule applies if the requested path matches the given path pattern. |
PathPatterns | (deprecated) Rule applies if the requested path matches any of the given patterns. |
Priority | Priority of the rule. |
RedirectResponse | (deprecated) Redirect response to return. |
TargetGroups | Target groups to forward requests to. |
Constructors
ApplicationListenerRuleProps()
public ApplicationListenerRuleProps()
Properties
Action
Action to perform when requests are received.
public ListenerAction Action { get; set; }
Property Value
Remarks
Only one of action
, fixedResponse
, redirectResponse
or targetGroups
can be specified.
Default: - No action
Conditions
Rule applies if matches the conditions.
public ListenerCondition[] Conditions { get; set; }
Property Value
Remarks
Default: - No conditions.
See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html
FixedResponse
(deprecated) Fixed response to return.
public IFixedResponse FixedResponse { get; set; }
Property Value
Remarks
Only one of action
, fixedResponse
, redirectResponse
or targetGroups
can be specified.
Default: - No fixed response.
Stability: Deprecated
HostHeader
(deprecated) Rule applies if the requested host matches the indicated host.
public string HostHeader { get; set; }
Property Value
System.String
Remarks
May contain up to three '*' wildcards.
Default: - No host condition.
Stability: Deprecated
Listener
The listener to attach the rule to.
public IApplicationListener Listener { get; set; }
Property Value
PathPattern
(deprecated) Rule applies if the requested path matches the given path pattern.
public string PathPattern { get; set; }
Property Value
System.String
Remarks
Default: - No path condition.
Stability: Deprecated
PathPatterns
(deprecated) Rule applies if the requested path matches any of the given patterns.
public string[] PathPatterns { get; set; }
Property Value
System.String[]
Remarks
Paths may contain up to three '*' wildcards.
Default: - No path conditions.
Stability: Deprecated
Priority
Priority of the rule.
public double Priority { get; set; }
Property Value
System.Double
Remarks
The rule with the lowest priority will be used for every request.
Priorities must be unique.
RedirectResponse
(deprecated) Redirect response to return.
public IRedirectResponse RedirectResponse { get; set; }
Property Value
Remarks
Only one of action
, fixedResponse
, redirectResponse
or targetGroups
can be specified.
Default: - No redirect response.
Stability: Deprecated
TargetGroups
Target groups to forward requests to.
public IApplicationTargetGroup[] TargetGroups { get; set; }
Property Value
Remarks
Only one of action
, fixedResponse
, redirectResponse
or targetGroups
can be specified.
Implies a forward
action.
Default: - No target groups.