Class ApplicationListenerRule

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationListenerRule
All Implemented Interfaces:
IConstruct, IDependable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:44.176Z") @Stability(Stable) public class ApplicationListenerRule extends Construct
Define a new listener rule.

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.*;
 ApplicationListener applicationListener;
 ApplicationTargetGroup applicationTargetGroup;
 ListenerAction listenerAction;
 ListenerCondition listenerCondition;
 ApplicationListenerRule applicationListenerRule = ApplicationListenerRule.Builder.create(this, "MyApplicationListenerRule")
         .listener(applicationListener)
         .priority(123)
         // the properties below are optional
         .action(listenerAction)
         .conditions(List.of(listenerCondition))
         .fixedResponse(FixedResponse.builder()
                 .statusCode("statusCode")
                 // the properties below are optional
                 .contentType(ContentType.TEXT_PLAIN)
                 .messageBody("messageBody")
                 .build())
         .hostHeader("hostHeader")
         .pathPattern("pathPattern")
         .pathPatterns(List.of("pathPatterns"))
         .redirectResponse(RedirectResponse.builder()
                 .statusCode("statusCode")
                 // the properties below are optional
                 .host("host")
                 .path("path")
                 .port("port")
                 .protocol("protocol")
                 .query("query")
                 .build())
         .targetGroups(List.of(applicationTargetGroup))
         .build();
 
  • Constructor Details

    • ApplicationListenerRule

      protected ApplicationListenerRule(software.amazon.jsii.JsiiObjectRef objRef)
    • ApplicationListenerRule

      protected ApplicationListenerRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ApplicationListenerRule

      @Stability(Stable) public ApplicationListenerRule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ApplicationListenerRuleProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • addCondition

      @Stability(Stable) public void addCondition(@NotNull ListenerCondition condition)
      Add a non-standard condition to this rule.

      Parameters:
      condition - This parameter is required.
    • addFixedResponse

      @Stability(Deprecated) @Deprecated public void addFixedResponse(@NotNull FixedResponse fixedResponse)
      Deprecated.
      Use configureAction instead
      (deprecated) Add a fixed response.

      Parameters:
      fixedResponse - This parameter is required.
    • addRedirectResponse

      @Stability(Deprecated) @Deprecated public void addRedirectResponse(@NotNull RedirectResponse redirectResponse)
      Deprecated.
      Use configureAction instead
      (deprecated) Add a redirect response.

      Parameters:
      redirectResponse - This parameter is required.
    • addTargetGroup

      @Stability(Deprecated) @Deprecated public void addTargetGroup(@NotNull IApplicationTargetGroup targetGroup)
      Deprecated.
      Use configureAction instead
      (deprecated) Add a TargetGroup to load balance to.

      Parameters:
      targetGroup - This parameter is required.
    • configureAction

      @Stability(Stable) public void configureAction(@NotNull ListenerAction action)
      Configure the action to perform for this rule.

      Parameters:
      action - This parameter is required.
    • setCondition

      @Stability(Deprecated) @Deprecated public void setCondition(@NotNull String field, @Nullable List<String> values)
      Deprecated.
      use addCondition instead.
      (deprecated) Add a non-standard condition to this rule.

      If the condition conflicts with an already set condition, it will be overwritten by the one you specified.

      Parameters:
      field - This parameter is required.
      values -
    • setCondition

      @Stability(Deprecated) @Deprecated public void setCondition(@NotNull String field)
      Deprecated.
      use addCondition instead.
      (deprecated) Add a non-standard condition to this rule.

      If the condition conflicts with an already set condition, it will be overwritten by the one you specified.

      Parameters:
      field - This parameter is required.
    • validate

      @Stability(Stable) @NotNull protected List<String> validate()
      Validate the rule.
      Overrides:
      validate in class Construct
      Returns:
      An array of validation error messages, or an empty array if the construct is valid.
    • getListenerRuleArn

      @Stability(Stable) @NotNull public String getListenerRuleArn()
      The ARN of this rule.