Class CfnListener
A CloudFormation AWS::ElasticLoadBalancingV2::Listener
.
Inherited Members
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.AWS.ElasticLoadBalancingV2.dll
Syntax (csharp)
public class CfnListener : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnListener
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElasticLoadBalancingV2;
var cfnListener = new CfnListener(this, "MyCfnListener", new CfnListenerProps {
DefaultActions = new [] { new ActionProperty {
Type = "type",
// the properties below are optional
AuthenticateCognitoConfig = new AuthenticateCognitoConfigProperty {
UserPoolArn = "userPoolArn",
UserPoolClientId = "userPoolClientId",
UserPoolDomain = "userPoolDomain",
// the properties below are optional
AuthenticationRequestExtraParams = new Dictionary<string, string> {
{ "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams" }
},
OnUnauthenticatedRequest = "onUnauthenticatedRequest",
Scope = "scope",
SessionCookieName = "sessionCookieName",
SessionTimeout = "sessionTimeout"
},
AuthenticateOidcConfig = new AuthenticateOidcConfigProperty {
AuthorizationEndpoint = "authorizationEndpoint",
ClientId = "clientId",
Issuer = "issuer",
TokenEndpoint = "tokenEndpoint",
UserInfoEndpoint = "userInfoEndpoint",
// the properties below are optional
AuthenticationRequestExtraParams = new Dictionary<string, string> {
{ "authenticationRequestExtraParamsKey", "authenticationRequestExtraParams" }
},
ClientSecret = "clientSecret",
OnUnauthenticatedRequest = "onUnauthenticatedRequest",
Scope = "scope",
SessionCookieName = "sessionCookieName",
SessionTimeout = "sessionTimeout",
UseExistingClientSecret = false
},
FixedResponseConfig = new FixedResponseConfigProperty {
StatusCode = "statusCode",
// the properties below are optional
ContentType = "contentType",
MessageBody = "messageBody"
},
ForwardConfig = new ForwardConfigProperty {
TargetGroups = new [] { new TargetGroupTupleProperty {
TargetGroupArn = "targetGroupArn",
Weight = 123
} },
TargetGroupStickinessConfig = new TargetGroupStickinessConfigProperty {
DurationSeconds = 123,
Enabled = false
}
},
Order = 123,
RedirectConfig = new RedirectConfigProperty {
StatusCode = "statusCode",
// the properties below are optional
Host = "host",
Path = "path",
Port = "port",
Protocol = "protocol",
Query = "query"
},
TargetGroupArn = "targetGroupArn"
} },
LoadBalancerArn = "loadBalancerArn",
// the properties below are optional
AlpnPolicy = new [] { "alpnPolicy" },
Certificates = new [] { new CertificateProperty {
CertificateArn = "certificateArn"
} },
Port = 123,
Protocol = "protocol",
SslPolicy = "sslPolicy"
});
Synopsis
Constructors
CfnListener(Construct, String, ICfnListenerProps) | Create a new |
CfnListener(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnListener(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AlpnPolicy | [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy. |
AttrListenerArn | The Amazon Resource Name (ARN) of the listener. |
Certificates | The default SSL server certificate for a secure listener. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
DefaultActions | The actions for the default rule. You cannot define a condition for a default rule. |
LoadBalancerArn | The Amazon Resource Name (ARN) of the load balancer. |
Port | The port on which the load balancer is listening. |
Protocol | The protocol for connections from clients to the load balancer. |
SslPolicy | [HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnListener(Construct, String, ICfnListenerProps)
Create a new AWS::ElasticLoadBalancingV2::Listener
.
public CfnListener(Construct scope, string id, ICfnListenerProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnListenerProps
- resource properties.
CfnListener(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnListener(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnListener(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnListener(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AlpnPolicy
[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.
public virtual string[] AlpnPolicy { get; set; }
Property Value
System.String[]
Remarks
AttrListenerArn
The Amazon Resource Name (ARN) of the listener.
public virtual string AttrListenerArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: ListenerArn
Certificates
The default SSL server certificate for a secure listener.
public virtual object Certificates { get; set; }
Property Value
System.Object
Remarks
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 .
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
DefaultActions
The actions for the default rule. You cannot define a condition for a default rule.
public virtual object DefaultActions { get; set; }
Property Value
System.Object
Remarks
To create additional rules for an Application Load Balancer, use AWS::ElasticLoadBalancingV2::ListenerRule .
LoadBalancerArn
The Amazon Resource Name (ARN) of the load balancer.
public virtual string LoadBalancerArn { get; set; }
Property Value
System.String
Remarks
Port
The port on which the load balancer is listening.
public virtual Nullable<double> Port { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
You cannot specify a port for a Gateway Load Balancer.
Protocol
The protocol for connections from clients to the load balancer.
public virtual string Protocol { get; set; }
Property Value
System.String
Remarks
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.
SslPolicy
[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.
public virtual string SslPolicy { get; set; }
Property Value
System.String
Remarks
For more information, see Security policies in the Application Load Balancers Guide and Security policies in the Network Load Balancers Guide .
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>