Class CfnListener
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::ElasticLoadBalancingV2::Listener
.
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())) .port(123) .protocol("protocol") .sslPolicy("sslPolicy") .build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Specifies an action for a listener rule.static interface
Specifies information required when integrating with Amazon Cognito to authenticate users.static interface
Specifies information required using an identity provide (IdP) that is compliant with OpenID Connect (OIDC) to authenticate users.static final class
A fluent builder forCfnListener
.static interface
Specifies an SSL server certificate to use as the default certificate for a secure listener.static interface
Specifies information required when returning a custom HTTP response.static interface
Information for creating an action that distributes requests among one or more target groups.static interface
Information about a redirect action.static interface
Information about the target group stickiness for a rule.static interface
Information about how traffic will be distributed between multiple target groups in a forward rule.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnListener
(Construct scope, String id, CfnListenerProps props) Create a newAWS::ElasticLoadBalancingV2::Listener
.protected
CfnListener
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnListener
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescription[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.The Amazon Resource Name (ARN) of the listener.The default SSL server certificate for a secure listener.The actions for the default rule.The Amazon Resource Name (ARN) of the load balancer.getPort()
The port on which the load balancer is listening.The protocol for connections from clients to the load balancer.[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAlpnPolicy
(List<String> value) [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.void
setCertificates
(List<Object> value) The default SSL server certificate for a secure listener.void
setCertificates
(IResolvable value) The default SSL server certificate for a secure listener.void
setDefaultActions
(List<Object> value) The actions for the default rule.void
setDefaultActions
(IResolvable value) The actions for the default rule.void
setLoadBalancerArn
(String value) The Amazon Resource Name (ARN) of the load balancer.void
The port on which the load balancer is listening.void
setProtocol
(String value) The protocol for connections from clients to the load balancer.void
setSslPolicy
(String value) [HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 newAWS::ElasticLoadBalancingV2::Listener
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrListenerArn
The Amazon Resource Name (ARN) of the listener. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getDefaultActions
The actions for the default rule. You cannot define a condition for a default rule.To create additional rules for an Application Load Balancer, use AWS::ElasticLoadBalancingV2::ListenerRule .
-
setDefaultActions
The actions for the default rule. You cannot define a condition for a default rule.To create additional rules for an Application Load Balancer, use AWS::ElasticLoadBalancingV2::ListenerRule .
-
setDefaultActions
The actions for the default rule. You cannot define a condition for a default rule.To create additional rules for an Application Load Balancer, use AWS::ElasticLoadBalancingV2::ListenerRule .
-
getLoadBalancerArn
The Amazon Resource Name (ARN) of the load balancer. -
setLoadBalancerArn
The Amazon Resource Name (ARN) of the load balancer. -
getAlpnPolicy
[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy. -
setAlpnPolicy
[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy. -
getCertificates
The default SSL server certificate for a secure listener.You must provide exactly one certificate if the listener protocol is HTTPS or TLS.
To create a certificate list for a secure listener, use AWS::ElasticLoadBalancingV2::ListenerCertificate .
-
setCertificates
The default SSL server certificate for a secure listener.You must provide exactly one certificate if the listener protocol is HTTPS or TLS.
To create a certificate list for a secure listener, use AWS::ElasticLoadBalancingV2::ListenerCertificate .
-
setCertificates
The default SSL server certificate for a secure listener.You must provide exactly one certificate if the listener protocol is HTTPS or TLS.
To create a certificate list for a secure listener, use AWS::ElasticLoadBalancingV2::ListenerCertificate .
-
getPort
The port on which the load balancer is listening.You cannot specify a port for a Gateway Load Balancer.
-
setPort
The port on which the load balancer is listening.You cannot specify a port for a Gateway Load Balancer.
-
getProtocol
The protocol for connections from clients to the load balancer.For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You cannot specify a protocol for a Gateway Load Balancer.
-
setProtocol
The protocol for connections from clients to the load balancer.For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You cannot specify a protocol for a Gateway Load Balancer.
-
getSslPolicy
[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.For more information, see Security policies in the Application Load Balancers Guide and Security policies in the Network Load Balancers Guide .
-
setSslPolicy
[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.For more information, see Security policies in the Application Load Balancers Guide and Security policies in the Network Load Balancers Guide .
-