@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.512Z") @Stability(value=Stable) public class CfnListener extends CfnResource implements IInspectable
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnListener.Builder
A fluent builder for
CfnListener. |
static interface |
CfnListener.PortRangeProperty
A complex type for a range of ports for a listener.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnListener(software.constructs.Construct scope,
String id,
CfnListenerProps props)
Create a new `AWS::GlobalAccelerator::Listener`.
|
protected |
CfnListener(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnListener(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAcceleratorArn()
The Amazon Resource Name (ARN) of your accelerator.
|
String |
getAttrListenerArn()
The ARN of the listener, such as `arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz` .
|
protected Map<String,Object> |
getCfnProperties() |
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.
|
Object |
getPortRanges()
The list of port ranges for the connections from clients to the accelerator.
|
String |
getProtocol()
The protocol for the connections from clients to the accelerator.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAcceleratorArn(String value)
The Amazon Resource Name (ARN) of your accelerator.
|
void |
setClientAffinity(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.
|
void |
setPortRanges(IResolvable value)
The list of port ranges for the connections from clients to the accelerator.
|
void |
setPortRanges(List<Object> value)
The list of port ranges for the connections from clients to the accelerator.
|
void |
setProtocol(String value)
The protocol for the connections from clients to the accelerator.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnListener(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnListener(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnListener(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnListenerProps props)
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.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrListenerArn()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getAcceleratorArn()
@Stability(value=Stable)
public void setAcceleratorArn(@NotNull
String value)
@Stability(value=Stable) @NotNull public Object getPortRanges()
@Stability(value=Stable)
public void setPortRanges(@NotNull
IResolvable value)
@Stability(value=Stable)
public void setPortRanges(@NotNull
List<Object> value)
@Stability(value=Stable) @NotNull public String getProtocol()
@Stability(value=Stable)
public void setProtocol(@NotNull
String value)
@Stability(value=Stable) @Nullable public String getClientAffinity()
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 .
@Stability(value=Stable)
public void setClientAffinity(@Nullable
String value)
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 .
Copyright © 2022. All rights reserved.