java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.elasticloadbalancingv2.CfnListener
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-17T05:10:10.977Z") @Stability(Stable) public class CfnListener extends CfnResource implements IInspectable
Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.

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.*;
 CfnListener cfnListener = CfnListener.Builder.create(this, "MyCfnListener")
         .defaultActions(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("sessionTimeout")
                         .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("sessionTimeout")
                         .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()))
         .loadBalancerArn("loadBalancerArn")
         // the properties below are optional
         .alpnPolicy(List.of("alpnPolicy"))
         .certificates(List.of(CertificateProperty.builder()
                 .certificateArn("certificateArn")
                 .build()))
         .mutualAuthentication(MutualAuthenticationProperty.builder()
                 .ignoreClientCertificateExpiry(false)
                 .mode("mode")
                 .trustStoreArn("trustStoreArn")
                 .build())
         .port(123)
         .protocol("protocol")
         .sslPolicy("sslPolicy")
         .build();
 

See Also:
  • 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

    • CfnListener

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

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

      @Stability(Stable) public CfnListener(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnListenerProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). 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.
    • getAttrListenerArn

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

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

      @Stability(Stable) @NotNull public Object getDefaultActions()
      The actions for the default rule.

      You cannot define a condition for a default rule.

    • setDefaultActions

      @Stability(Stable) public void setDefaultActions(@NotNull IResolvable value)
      The actions for the default rule.

      You cannot define a condition for a default rule.

    • setDefaultActions

      @Stability(Stable) public void setDefaultActions(@NotNull List<Object> value)
      The actions for the default rule.

      You cannot define a condition for a default rule.

    • getLoadBalancerArn

      @Stability(Stable) @NotNull public String getLoadBalancerArn()
      The Amazon Resource Name (ARN) of the load balancer.
    • setLoadBalancerArn

      @Stability(Stable) public void setLoadBalancerArn(@NotNull String value)
      The Amazon Resource Name (ARN) of the load balancer.
    • getAlpnPolicy

      @Stability(Stable) @Nullable public List<String> getAlpnPolicy()
      [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.
    • setAlpnPolicy

      @Stability(Stable) public void setAlpnPolicy(@Nullable List<String> value)
      [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.
    • getCertificates

      @Stability(Stable) @Nullable public Object getCertificates()
      The default SSL server certificate for a secure listener.
    • setCertificates

      @Stability(Stable) public void setCertificates(@Nullable IResolvable value)
      The default SSL server certificate for a secure listener.
    • setCertificates

      @Stability(Stable) public void setCertificates(@Nullable List<Object> value)
      The default SSL server certificate for a secure listener.
    • getMutualAuthentication

      @Stability(Stable) @Nullable public Object getMutualAuthentication()
      The mutual authentication configuration information.
    • setMutualAuthentication

      @Stability(Stable) public void setMutualAuthentication(@Nullable IResolvable value)
      The mutual authentication configuration information.
    • setMutualAuthentication

      @Stability(Stable) public void setMutualAuthentication(@Nullable CfnListener.MutualAuthenticationProperty value)
      The mutual authentication configuration information.
    • getPort

      @Stability(Stable) @Nullable public Number getPort()
      The port on which the load balancer is listening.
    • setPort

      @Stability(Stable) public void setPort(@Nullable Number value)
      The port on which the load balancer is listening.
    • getProtocol

      @Stability(Stable) @Nullable public String getProtocol()
      The protocol for connections from clients to the load balancer.
    • setProtocol

      @Stability(Stable) public void setProtocol(@Nullable String value)
      The protocol for connections from clients to the load balancer.
    • getSslPolicy

      @Stability(Stable) @Nullable public String getSslPolicy()
      [HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.
    • setSslPolicy

      @Stability(Stable) public void setSslPolicy(@Nullable String value)
      [HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.