java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:44.254Z") @Stability(Stable) public class CfnListenerRule extends CfnResource implements IInspectable
A CloudFormation AWS::ElasticLoadBalancingV2::ListenerRule.

Specifies a listener rule. The listener must be associated with an Application Load Balancer. Each rule consists of a priority, one or more actions, and one or more conditions.

For more information, see Quotas for your Application Load Balancers in the User Guide for Application Load Balancers .

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.*;
 CfnListenerRule cfnListenerRule = CfnListenerRule.Builder.create(this, "MyCfnListenerRule")
         .actions(List.of(ActionProperty.builder()
                 .type("type")
                 // the properties below are optional
                 .authenticateCognitoConfig(AuthenticateCognitoConfigProperty.builder()
                         .userPoolArn("userPoolArn")
                         .userPoolClientId("userPoolClientId")
                         .userPoolDomain("userPoolDomain")
                         // the properties below are optional
                         .authenticationRequestExtraParams(Map.of(
                                 "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams"))
                         .onUnauthenticatedRequest("onUnauthenticatedRequest")
                         .scope("scope")
                         .sessionCookieName("sessionCookieName")
                         .sessionTimeout(123)
                         .build())
                 .authenticateOidcConfig(AuthenticateOidcConfigProperty.builder()
                         .authorizationEndpoint("authorizationEndpoint")
                         .clientId("clientId")
                         .issuer("issuer")
                         .tokenEndpoint("tokenEndpoint")
                         .userInfoEndpoint("userInfoEndpoint")
                         // the properties below are optional
                         .authenticationRequestExtraParams(Map.of(
                                 "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams"))
                         .clientSecret("clientSecret")
                         .onUnauthenticatedRequest("onUnauthenticatedRequest")
                         .scope("scope")
                         .sessionCookieName("sessionCookieName")
                         .sessionTimeout(123)
                         .useExistingClientSecret(false)
                         .build())
                 .fixedResponseConfig(FixedResponseConfigProperty.builder()
                         .statusCode("statusCode")
                         // the properties below are optional
                         .contentType("contentType")
                         .messageBody("messageBody")
                         .build())
                 .forwardConfig(ForwardConfigProperty.builder()
                         .targetGroups(List.of(TargetGroupTupleProperty.builder()
                                 .targetGroupArn("targetGroupArn")
                                 .weight(123)
                                 .build()))
                         .targetGroupStickinessConfig(TargetGroupStickinessConfigProperty.builder()
                                 .durationSeconds(123)
                                 .enabled(false)
                                 .build())
                         .build())
                 .order(123)
                 .redirectConfig(RedirectConfigProperty.builder()
                         .statusCode("statusCode")
                         // the properties below are optional
                         .host("host")
                         .path("path")
                         .port("port")
                         .protocol("protocol")
                         .query("query")
                         .build())
                 .targetGroupArn("targetGroupArn")
                 .build()))
         .conditions(List.of(RuleConditionProperty.builder()
                 .field("field")
                 .hostHeaderConfig(HostHeaderConfigProperty.builder()
                         .values(List.of("values"))
                         .build())
                 .httpHeaderConfig(HttpHeaderConfigProperty.builder()
                         .httpHeaderName("httpHeaderName")
                         .values(List.of("values"))
                         .build())
                 .httpRequestMethodConfig(HttpRequestMethodConfigProperty.builder()
                         .values(List.of("values"))
                         .build())
                 .pathPatternConfig(PathPatternConfigProperty.builder()
                         .values(List.of("values"))
                         .build())
                 .queryStringConfig(QueryStringConfigProperty.builder()
                         .values(List.of(QueryStringKeyValueProperty.builder()
                                 .key("key")
                                 .value("value")
                                 .build()))
                         .build())
                 .sourceIpConfig(SourceIpConfigProperty.builder()
                         .values(List.of("values"))
                         .build())
                 .values(List.of("values"))
                 .build()))
         .priority(123)
         // the properties below are optional
         .listenerArn("listenerArn")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnListenerRule

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

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

      @Stability(Stable) public CfnListenerRule(@NotNull Construct scope, @NotNull String id, @NotNull CfnListenerRuleProps props)
      Create a new AWS::ElasticLoadBalancingV2::ListenerRule.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrIsDefault

      @Stability(Stable) @NotNull public IResolvable getAttrIsDefault()
      Indicates whether this is the default rule.
    • getAttrRuleArn

      @Stability(Stable) @NotNull public String getAttrRuleArn()
      The Amazon Resource Name (ARN) of the rule.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getActions

      @Stability(Stable) @NotNull public Object getActions()
      The actions.

      The rule must include exactly one of the following types of actions: forward , fixed-response , or redirect , and it must be the last action to be performed. If the rule is for an HTTPS listener, it can also optionally include an authentication action.

    • setActions

      @Stability(Stable) public void setActions(@NotNull IResolvable value)
      The actions.

      The rule must include exactly one of the following types of actions: forward , fixed-response , or redirect , and it must be the last action to be performed. If the rule is for an HTTPS listener, it can also optionally include an authentication action.

    • setActions

      @Stability(Stable) public void setActions(@NotNull List<Object> value)
      The actions.

      The rule must include exactly one of the following types of actions: forward , fixed-response , or redirect , and it must be the last action to be performed. If the rule is for an HTTPS listener, it can also optionally include an authentication action.

    • getConditions

      @Stability(Stable) @NotNull public Object getConditions()
      The conditions.

      The rule can optionally include up to one of each of the following conditions: http-request-method , host-header , path-pattern , and source-ip . A rule can also optionally include one or more of each of the following conditions: http-header and query-string .

    • setConditions

      @Stability(Stable) public void setConditions(@NotNull IResolvable value)
      The conditions.

      The rule can optionally include up to one of each of the following conditions: http-request-method , host-header , path-pattern , and source-ip . A rule can also optionally include one or more of each of the following conditions: http-header and query-string .

    • setConditions

      @Stability(Stable) public void setConditions(@NotNull List<Object> value)
      The conditions.

      The rule can optionally include up to one of each of the following conditions: http-request-method , host-header , path-pattern , and source-ip . A rule can also optionally include one or more of each of the following conditions: http-header and query-string .

    • getPriority

      @Stability(Stable) @NotNull public Number getPriority()
      The rule priority. A listener can't have multiple rules with the same priority.

      If you try to reorder rules by updating their priorities, do not specify a new priority if an existing rule already uses this priority, as this can cause an error. If you need to reuse a priority with a different rule, you must remove it as a priority first, and then specify it in a subsequent update.

    • setPriority

      @Stability(Stable) public void setPriority(@NotNull Number value)
      The rule priority. A listener can't have multiple rules with the same priority.

      If you try to reorder rules by updating their priorities, do not specify a new priority if an existing rule already uses this priority, as this can cause an error. If you need to reuse a priority with a different rule, you must remove it as a priority first, and then specify it in a subsequent update.

    • getListenerArn

      @Stability(Stable) @Nullable public String getListenerArn()
      The Amazon Resource Name (ARN) of the listener.
    • setListenerArn

      @Stability(Stable) public void setListenerArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the listener.