java.lang.Object
software.amazon.jsii.JsiiObject
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:45.505Z") @Stability(Stable) public class CfnListener extends CfnResource implements IInspectable
A CloudFormation AWS::GlobalAccelerator::Listener.

The AWS::GlobalAccelerator::Listener resource is a Global Accelerator resource type that contains information about how you create a listener to process inbound connections from clients to an accelerator. Connections arrive to assigned static IP addresses on a port, port range, or list of port ranges that you specify.

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.globalaccelerator.*;
 CfnListener cfnListener = CfnListener.Builder.create(this, "MyCfnListener")
         .acceleratorArn("acceleratorArn")
         .portRanges(List.of(PortRangeProperty.builder()
                 .fromPort(123)
                 .toPort(123)
                 .build()))
         .protocol("protocol")
         // the properties below are optional
         .clientAffinity("clientAffinity")
         .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

    • CfnListener

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

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

      @Stability(Stable) public CfnListener(@NotNull Construct scope, @NotNull String id, @NotNull CfnListenerProps props)
      Create a new AWS::GlobalAccelerator::Listener.

      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.
    • getAttrListenerArn

      @Stability(Stable) @NotNull public String getAttrListenerArn()
      The ARN of the listener, such as arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz .
    • getCfnProperties

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

      @Stability(Stable) @NotNull public String getAcceleratorArn()
      The Amazon Resource Name (ARN) of your accelerator.
    • setAcceleratorArn

      @Stability(Stable) public void setAcceleratorArn(@NotNull String value)
      The Amazon Resource Name (ARN) of your accelerator.
    • getPortRanges

      @Stability(Stable) @NotNull public Object getPortRanges()
      The list of port ranges for the connections from clients to the accelerator.
    • setPortRanges

      @Stability(Stable) public void setPortRanges(@NotNull IResolvable value)
      The list of port ranges for the connections from clients to the accelerator.
    • setPortRanges

      @Stability(Stable) public void setPortRanges(@NotNull List<Object> value)
      The list of port ranges for the connections from clients to the accelerator.
    • getProtocol

      @Stability(Stable) @NotNull public String getProtocol()
      The protocol for the connections from clients to the accelerator.
    • setProtocol

      @Stability(Stable) public void setProtocol(@NotNull String value)
      The protocol for the connections from clients to the accelerator.
    • getClientAffinity

      @Stability(Stable) @Nullable public String getClientAffinity()
      Client affinity lets you direct all requests from a user to the same endpoint, if you have stateful applications, regardless of the port and protocol of the client request.

      Client affinity gives you control over whether to always route each client to the same specific endpoint.

      AWS Global Accelerator uses a consistent-flow hashing algorithm to choose the optimal endpoint for a connection. If client affinity is NONE , Global Accelerator uses the "five-tuple" (5-tuple) properties—source IP address, source port, destination IP address, destination port, and protocol—to select the hash value, and then chooses the best endpoint. However, with this setting, if someone uses different ports to connect to Global Accelerator, their connections might not be always routed to the same endpoint because the hash value changes.

      If you want a given client to always be routed to the same endpoint, set client affinity to SOURCE_IP instead. When you use the SOURCE_IP setting, Global Accelerator uses the "two-tuple" (2-tuple) properties— source (client) IP address and destination IP address—to select the hash value.

      The default value is NONE .

    • setClientAffinity

      @Stability(Stable) public void setClientAffinity(@Nullable String value)
      Client affinity lets you direct all requests from a user to the same endpoint, if you have stateful applications, regardless of the port and protocol of the client request.

      Client affinity gives you control over whether to always route each client to the same specific endpoint.

      AWS Global Accelerator uses a consistent-flow hashing algorithm to choose the optimal endpoint for a connection. If client affinity is NONE , Global Accelerator uses the "five-tuple" (5-tuple) properties—source IP address, source port, destination IP address, destination port, and protocol—to select the hash value, and then chooses the best endpoint. However, with this setting, if someone uses different ports to connect to Global Accelerator, their connections might not be always routed to the same endpoint because the hash value changes.

      If you want a given client to always be routed to the same endpoint, set client affinity to SOURCE_IP instead. When you use the SOURCE_IP setting, Global Accelerator uses the "two-tuple" (2-tuple) properties— source (client) IP address and destination IP address—to select the hash value.

      The default value is NONE .