Class CfnListener
Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
Inherited Members
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnListener : CfnResource, IInspectable, IListenerRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CfnListener Inherits CfnResource Implements IInspectable, IListenerRef, IConstruct, IDependable, IEnvironmentAware
Remarks
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
}
},
JwtValidationConfig = new JwtValidationConfigProperty {
Issuer = "issuer",
JwksEndpoint = "jwksEndpoint",
// the properties below are optional
AdditionalClaims = new [] { new JwtValidationActionAdditionalClaimProperty {
Format = "format",
Name = "name",
Values = new [] { "values" }
} }
},
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"
} },
ListenerAttributes = new [] { new ListenerAttributeProperty {
Key = "key",
Value = "value"
} },
MutualAuthentication = new MutualAuthenticationProperty {
AdvertiseTrustStoreCaNames = "advertiseTrustStoreCaNames",
IgnoreClientCertificateExpiry = false,
Mode = "mode",
TrustStoreArn = "trustStoreArn"
},
Port = 123,
Protocol = "protocol",
SslPolicy = "sslPolicy"
});
Synopsis
Constructors
| CfnListener(Construct, string, ICfnListenerProps) | Create a new |
Properties
| AlpnPolicy | [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy. |
| AttrListenerArn | The Amazon Resource Name (ARN) of the listener. |
| CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
| Certificates | The default SSL server certificate for a secure listener. |
| CfnProperties | Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. |
| CfnPropertyNames | Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. |
| DefaultActions | The actions for the default rule. |
| ListenerAttributes | The listener attributes. |
| ListenerRef | A reference to a Listener resource. |
| LoadBalancerArn | The Amazon Resource Name (ARN) of the load balancer. |
| MutualAuthentication | The mutual authentication configuration information. |
| 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
| ArnForListener(IListenerRef) | Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. |
| Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
| IsCfnListener(object) | Checks whether the given object is a CfnListener. |
| RenderProperties(IDictionary<string, object>) | Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. |
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 string
Construct identifier for this resource (unique in its scope).
- props ICfnListenerProps
Resource properties.
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
Properties
AlpnPolicy
[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.
public virtual string[]? AlpnPolicy { get; set; }
Property Value
string[]
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
AttrListenerArn
The Amazon Resource Name (ARN) of the listener.
public virtual string AttrListenerArn { get; }
Property Value
Remarks
CloudformationAttribute: ListenerArn
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
Certificates
The default SSL server certificate for a secure listener.
public virtual object? Certificates { get; set; }
Property Value
Remarks
Type union: either IResolvable or (either IResolvable or CfnListener.ICertificateProperty)[]
CfnProperties
Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
Overrides
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
CfnPropertyNames
Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
protected override IDictionary<string, string> CfnPropertyNames { get; }
Property Value
Overrides
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
DefaultActions
The actions for the default rule.
public virtual object DefaultActions { get; set; }
Property Value
Remarks
You cannot define a condition for a default rule.
Type union: either IResolvable or (either IResolvable or CfnListener.IActionProperty)[]
ListenerAttributes
The listener attributes.
public virtual object? ListenerAttributes { get; set; }
Property Value
Remarks
Type union: either IResolvable or (either IResolvable or CfnListener.IListenerAttributeProperty)[]
ListenerRef
A reference to a Listener resource.
public virtual IListenerReference ListenerRef { get; }
Property Value
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
LoadBalancerArn
The Amazon Resource Name (ARN) of the load balancer.
public virtual string LoadBalancerArn { get; set; }
Property Value
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
MutualAuthentication
The mutual authentication configuration information.
public virtual object? MutualAuthentication { get; set; }
Property Value
Remarks
Type union: either IResolvable or CfnListener.IMutualAuthenticationProperty
Port
The port on which the load balancer is listening.
public virtual double? Port { get; set; }
Property Value
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
Protocol
The protocol for connections from clients to the load balancer.
public virtual string? Protocol { get; set; }
Property Value
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
SslPolicy
[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.
public virtual string? SslPolicy { get; set; }
Property Value
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
Methods
ArnForListener(IListenerRef)
Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
public static string ArnForListener(IListenerRef resource)
Parameters
- resource IListenerRef
Returns
Remarks
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
}
},
JwtValidationConfig = new JwtValidationConfigProperty {
Issuer = "issuer",
JwksEndpoint = "jwksEndpoint",
// the properties below are optional
AdditionalClaims = new [] { new JwtValidationActionAdditionalClaimProperty {
Format = "format",
Name = "name",
Values = new [] { "values" }
} }
},
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"
} },
ListenerAttributes = new [] { new ListenerAttributeProperty {
Key = "key",
Value = "value"
} },
MutualAuthentication = new MutualAuthenticationProperty {
AdvertiseTrustStoreCaNames = "advertiseTrustStoreCaNames",
IgnoreClientCertificateExpiry = false,
Mode = "mode",
TrustStoreArn = "trustStoreArn"
},
Port = 123,
Protocol = "protocol",
SslPolicy = "sslPolicy"
});
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.
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
IsCfnListener(object)
Checks whether the given object is a CfnListener.
public static bool IsCfnListener(object x)
Parameters
- x object
Returns
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated
RenderProperties(IDictionary<string, object>)
Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props IDictionary<string, object>
Returns
Overrides
Remarks
CloudformationResource: AWS::ElasticLoadBalancingV2::Listener
ExampleMetadata: fixture=_generated