CfnListener¶
-
class
aws_cdk.aws_elasticloadbalancingv2.
CfnListener
(scope, id, *, default_actions, load_balancer_arn, alpn_policy=None, certificates=None, port=None, protocol=None, ssl_policy=None)¶ Bases:
aws_cdk.core.CfnResource
A CloudFormation
AWS::ElasticLoadBalancingV2::Listener
.Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
- CloudformationResource
AWS::ElasticLoadBalancingV2::Listener
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 cfn_listener = elbv2.CfnListener(self, "MyCfnListener", default_actions=[elbv2.CfnListener.ActionProperty( type="type", # the properties below are optional authenticate_cognito_config=elbv2.CfnListener.AuthenticateCognitoConfigProperty( user_pool_arn="userPoolArn", user_pool_client_id="userPoolClientId", user_pool_domain="userPoolDomain", # the properties below are optional authentication_request_extra_params={ "authentication_request_extra_params_key": "authenticationRequestExtraParams" }, on_unauthenticated_request="onUnauthenticatedRequest", scope="scope", session_cookie_name="sessionCookieName", session_timeout="sessionTimeout" ), authenticate_oidc_config=elbv2.CfnListener.AuthenticateOidcConfigProperty( authorization_endpoint="authorizationEndpoint", client_id="clientId", issuer="issuer", token_endpoint="tokenEndpoint", user_info_endpoint="userInfoEndpoint", # the properties below are optional authentication_request_extra_params={ "authentication_request_extra_params_key": "authenticationRequestExtraParams" }, client_secret="clientSecret", on_unauthenticated_request="onUnauthenticatedRequest", scope="scope", session_cookie_name="sessionCookieName", session_timeout="sessionTimeout", use_existing_client_secret=False ), fixed_response_config=elbv2.CfnListener.FixedResponseConfigProperty( status_code="statusCode", # the properties below are optional content_type="contentType", message_body="messageBody" ), forward_config=elbv2.CfnListener.ForwardConfigProperty( target_groups=[elbv2.CfnListener.TargetGroupTupleProperty( target_group_arn="targetGroupArn", weight=123 )], target_group_stickiness_config=elbv2.CfnListener.TargetGroupStickinessConfigProperty( duration_seconds=123, enabled=False ) ), order=123, redirect_config=elbv2.CfnListener.RedirectConfigProperty( status_code="statusCode", # the properties below are optional host="host", path="path", port="port", protocol="protocol", query="query" ), target_group_arn="targetGroupArn" )], load_balancer_arn="loadBalancerArn", # the properties below are optional alpn_policy=["alpnPolicy"], certificates=[elbv2.CfnListener.CertificateProperty( certificate_arn="certificateArn" )], port=123, protocol="protocol", ssl_policy="sslPolicy" )
Create a new
AWS::ElasticLoadBalancingV2::Listener
.- Parameters
scope (
Construct
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
default_actions (
Union
[IResolvable
,Sequence
[Union
[ActionProperty
,Dict
[str
,Any
],IResolvable
]]]) – 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 .load_balancer_arn (
str
) – The Amazon Resource Name (ARN) of the load balancer.alpn_policy (
Optional
[Sequence
[str
]]) – [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.certificates (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,CertificateProperty
,Dict
[str
,Any
]]],None
]) – 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 .port (
Union
[int
,float
,None
]) – The port on which the load balancer is listening. You cannot specify a port for a Gateway Load Balancer.protocol (
Optional
[str
]) – 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.ssl_policy (
Optional
[str
]) –[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 .
Methods
-
add_deletion_override
(path)¶ Syntactic sugar for
addOverride(path, undefined)
.- Parameters
path (
str
) – The path of the value to delete.- Return type
None
-
add_depends_on
(target)¶ Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters
target (
CfnResource
) –- Return type
None
-
add_metadata
(key, value)¶ Add a value to the CloudFormation Resource Metadata.
- Parameters
key (
str
) –value (
Any
) –
- See
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- Return type
None
-
add_override
(path, value)¶ Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type
None
-
add_property_deletion_override
(property_path)¶ Adds an override that deletes the value of a property from the resource definition.
- Parameters
property_path (
str
) – The path to the property.- Return type
None
-
add_property_override
(property_path, value)¶ Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type
None
-
apply_removal_policy
(policy=None, *, apply_to_update_replace_policy=None, default=None)¶ Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.
- Return type
None
-
get_att
(attribute_name)¶ Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters
attribute_name (
str
) – The name of the attribute.- Return type
-
get_metadata
(key)¶ Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters
key (
str
) –- See
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- Return type
Any
-
inspect
(inspector)¶ Examines the CloudFormation resource and discloses attributes.
- Parameters
inspector (
TreeInspector
) –tree inspector to collect and process attributes.
- Return type
None
-
override_logical_id
(new_logical_id)¶ Overrides the auto-generated logical ID with a specific ID.
- Parameters
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type
None
-
to_string
()¶ Returns a string representation of this construct.
- Return type
str
- Returns
a string representation of this resource
Attributes
-
CFN_RESOURCE_TYPE_NAME
= 'AWS::ElasticLoadBalancingV2::Listener'¶
-
alpn_policy
¶ [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.
-
attr_listener_arn
¶ The Amazon Resource Name (ARN) of the listener.
- CloudformationAttribute
ListenerArn
- Return type
str
-
certificates
¶ 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 .
-
cfn_options
¶ Options for this resource, such as condition, update policy etc.
- Return type
-
cfn_resource_type
¶ AWS resource type.
- Return type
str
-
creation_stack
¶ return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- Return type
List
[str
]
-
default_actions
¶ 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 .
-
load_balancer_arn
¶ The Amazon Resource Name (ARN) of the load balancer.
-
logical_id
¶ The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Return type
str
- Returns
the logical ID as a stringified token. This value will only get resolved during synthesis.
-
node
¶ The construct tree node associated with this construct.
- Return type
-
port
¶ The port on which the load balancer is listening.
You cannot specify a port for a Gateway Load Balancer.
- Link
- Return type
Union
[int
,float
,None
]
-
protocol
¶ 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.
-
ref
¶ Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.- Return type
str
-
ssl_policy
¶ [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 .
-
stack
¶ The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- Return type
Static Methods
-
classmethod
is_cfn_element
(x)¶ Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters
x (
Any
) –- Return type
bool
- Returns
The construct as a stack element or undefined if it is not a stack element.
-
classmethod
is_cfn_resource
(construct)¶ Check whether the given construct is a CfnResource.
- Parameters
construct (
IConstruct
) –- Return type
bool
-
classmethod
is_construct
(x)¶ Return whether the given object is a Construct.
- Parameters
x (
Any
) –- Return type
bool
ActionProperty¶
-
class
CfnListener.
ActionProperty
(*, type, authenticate_cognito_config=None, authenticate_oidc_config=None, fixed_response_config=None, forward_config=None, order=None, redirect_config=None, target_group_arn=None)¶ Bases:
object
Specifies an action for a listener rule.
- Parameters
type (
str
) – The type of action.authenticate_cognito_config (
Union
[IResolvable
,AuthenticateCognitoConfigProperty
,Dict
[str
,Any
],None
]) – [HTTPS listeners] Information for using Amazon Cognito to authenticate users. Specify only whenType
isauthenticate-cognito
.authenticate_oidc_config (
Union
[IResolvable
,AuthenticateOidcConfigProperty
,Dict
[str
,Any
],None
]) – [HTTPS listeners] Information about an identity provider that is compliant with OpenID Connect (OIDC). Specify only whenType
isauthenticate-oidc
.fixed_response_config (
Union
[IResolvable
,FixedResponseConfigProperty
,Dict
[str
,Any
],None
]) – [Application Load Balancer] Information for creating an action that returns a custom HTTP response. Specify only whenType
isfixed-response
.forward_config (
Union
[IResolvable
,ForwardConfigProperty
,Dict
[str
,Any
],None
]) – Information for creating an action that distributes requests among one or more target groups. For Network Load Balancers, you can specify a single target group. Specify only whenType
isforward
. If you specify bothForwardConfig
andTargetGroupArn
, you can specify only one target group usingForwardConfig
and it must be the same target group specified inTargetGroupArn
.order (
Union
[int
,float
,None
]) – The order for the action. This value is required for rules with multiple actions. The action with the lowest value for order is performed first.redirect_config (
Union
[IResolvable
,RedirectConfigProperty
,Dict
[str
,Any
],None
]) – [Application Load Balancer] Information for creating a redirect action. Specify only whenType
isredirect
.target_group_arn (
Optional
[str
]) – The Amazon Resource Name (ARN) of the target group. Specify only whenType
isforward
and you want to route to a single target group. To route to one or more target groups, useForwardConfig
instead.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 action_property = elbv2.CfnListener.ActionProperty( type="type", # the properties below are optional authenticate_cognito_config=elbv2.CfnListener.AuthenticateCognitoConfigProperty( user_pool_arn="userPoolArn", user_pool_client_id="userPoolClientId", user_pool_domain="userPoolDomain", # the properties below are optional authentication_request_extra_params={ "authentication_request_extra_params_key": "authenticationRequestExtraParams" }, on_unauthenticated_request="onUnauthenticatedRequest", scope="scope", session_cookie_name="sessionCookieName", session_timeout="sessionTimeout" ), authenticate_oidc_config=elbv2.CfnListener.AuthenticateOidcConfigProperty( authorization_endpoint="authorizationEndpoint", client_id="clientId", issuer="issuer", token_endpoint="tokenEndpoint", user_info_endpoint="userInfoEndpoint", # the properties below are optional authentication_request_extra_params={ "authentication_request_extra_params_key": "authenticationRequestExtraParams" }, client_secret="clientSecret", on_unauthenticated_request="onUnauthenticatedRequest", scope="scope", session_cookie_name="sessionCookieName", session_timeout="sessionTimeout", use_existing_client_secret=False ), fixed_response_config=elbv2.CfnListener.FixedResponseConfigProperty( status_code="statusCode", # the properties below are optional content_type="contentType", message_body="messageBody" ), forward_config=elbv2.CfnListener.ForwardConfigProperty( target_groups=[elbv2.CfnListener.TargetGroupTupleProperty( target_group_arn="targetGroupArn", weight=123 )], target_group_stickiness_config=elbv2.CfnListener.TargetGroupStickinessConfigProperty( duration_seconds=123, enabled=False ) ), order=123, redirect_config=elbv2.CfnListener.RedirectConfigProperty( status_code="statusCode", # the properties below are optional host="host", path="path", port="port", protocol="protocol", query="query" ), target_group_arn="targetGroupArn" )
Attributes
-
authenticate_cognito_config
¶ [HTTPS listeners] Information for using Amazon Cognito to authenticate users.
Specify only when
Type
isauthenticate-cognito
.
-
authenticate_oidc_config
¶ [HTTPS listeners] Information about an identity provider that is compliant with OpenID Connect (OIDC).
Specify only when
Type
isauthenticate-oidc
.
-
fixed_response_config
¶ [Application Load Balancer] Information for creating an action that returns a custom HTTP response.
Specify only when
Type
isfixed-response
.
-
forward_config
¶ Information for creating an action that distributes requests among one or more target groups.
For Network Load Balancers, you can specify a single target group. Specify only when
Type
isforward
. If you specify bothForwardConfig
andTargetGroupArn
, you can specify only one target group usingForwardConfig
and it must be the same target group specified inTargetGroupArn
.
-
order
¶ The order for the action.
This value is required for rules with multiple actions. The action with the lowest value for order is performed first.
-
redirect_config
¶ [Application Load Balancer] Information for creating a redirect action.
Specify only when
Type
isredirect
.
-
target_group_arn
¶ The Amazon Resource Name (ARN) of the target group.
Specify only when
Type
isforward
and you want to route to a single target group. To route to one or more target groups, useForwardConfig
instead.
-
type
¶ The type of action.
AuthenticateCognitoConfigProperty¶
-
class
CfnListener.
AuthenticateCognitoConfigProperty
(*, user_pool_arn, user_pool_client_id, user_pool_domain, authentication_request_extra_params=None, on_unauthenticated_request=None, scope=None, session_cookie_name=None, session_timeout=None)¶ Bases:
object
Specifies information required when integrating with Amazon Cognito to authenticate users.
- Parameters
user_pool_arn (
str
) – The Amazon Resource Name (ARN) of the Amazon Cognito user pool.user_pool_client_id (
str
) – The ID of the Amazon Cognito user pool client.user_pool_domain (
str
) – The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.authentication_request_extra_params (
Union
[IResolvable
,Mapping
[str
,str
],None
]) – The query parameters (up to 10) to include in the redirect request to the authorization endpoint.on_unauthenticated_request (
Optional
[str
]) – The behavior if the user is not authenticated. The following are possible values:. - deny `` - Return an HTTP 401 Unauthorized error. - allow `` - Allow the request to be forwarded to the target. - authenticate `` - Redirect the request to the IdP authorization endpoint. This is the default value.scope (
Optional
[str
]) – The set of user claims to be requested from the IdP. The default isopenid
. To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.session_cookie_name (
Optional
[str
]) – The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.session_timeout (
Optional
[str
]) – The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 authenticate_cognito_config_property = elbv2.CfnListener.AuthenticateCognitoConfigProperty( user_pool_arn="userPoolArn", user_pool_client_id="userPoolClientId", user_pool_domain="userPoolDomain", # the properties below are optional authentication_request_extra_params={ "authentication_request_extra_params_key": "authenticationRequestExtraParams" }, on_unauthenticated_request="onUnauthenticatedRequest", scope="scope", session_cookie_name="sessionCookieName", session_timeout="sessionTimeout" )
Attributes
-
authentication_request_extra_params
¶ The query parameters (up to 10) to include in the redirect request to the authorization endpoint.
-
on_unauthenticated_request
¶ .
deny `` - Return an HTTP 401 Unauthorized error.
allow `` - Allow the request to be forwarded to the target.
authenticate `` - Redirect the request to the IdP authorization endpoint. This is the default value.
- Link
- Type
The behavior if the user is not authenticated. The following are possible values
- Return type
Optional
[str
]
-
scope
¶ The set of user claims to be requested from the IdP. The default is
openid
.To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.
The name of the cookie used to maintain session information.
The default is AWSELBAuthSessionCookie.
-
session_timeout
¶ The maximum duration of the authentication session, in seconds.
The default is 604800 seconds (7 days).
-
user_pool_arn
¶ The Amazon Resource Name (ARN) of the Amazon Cognito user pool.
-
user_pool_client_id
¶ The ID of the Amazon Cognito user pool client.
-
user_pool_domain
¶ The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.
AuthenticateOidcConfigProperty¶
-
class
CfnListener.
AuthenticateOidcConfigProperty
(*, authorization_endpoint, client_id, issuer, token_endpoint, user_info_endpoint, authentication_request_extra_params=None, client_secret=None, on_unauthenticated_request=None, scope=None, session_cookie_name=None, session_timeout=None, use_existing_client_secret=None)¶ Bases:
object
Specifies information required using an identity provide (IdP) that is compliant with OpenID Connect (OIDC) to authenticate users.
- Parameters
authorization_endpoint (
str
) – The authorization endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.client_id (
str
) – The OAuth 2.0 client identifier.issuer (
str
) – The OIDC issuer identifier of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.token_endpoint (
str
) – The token endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.user_info_endpoint (
str
) – The user info endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path.authentication_request_extra_params (
Union
[IResolvable
,Mapping
[str
,str
],None
]) – The query parameters (up to 10) to include in the redirect request to the authorization endpoint.client_secret (
Optional
[str
]) – The OAuth 2.0 client secret. This parameter is required if you are creating a rule. If you are modifying a rule, you can omit this parameter if you setUseExistingClientSecret
to true.on_unauthenticated_request (
Optional
[str
]) – The behavior if the user is not authenticated. The following are possible values:. - deny `` - Return an HTTP 401 Unauthorized error. - allow `` - Allow the request to be forwarded to the target. - authenticate `` - Redirect the request to the IdP authorization endpoint. This is the default value.scope (
Optional
[str
]) – The set of user claims to be requested from the IdP. The default isopenid
. To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.session_cookie_name (
Optional
[str
]) – The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie.session_timeout (
Optional
[str
]) – The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days).use_existing_client_secret (
Union
[bool
,IResolvable
,None
]) –CfnListener.AuthenticateOidcConfigProperty.UseExistingClientSecret
.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 authenticate_oidc_config_property = elbv2.CfnListener.AuthenticateOidcConfigProperty( authorization_endpoint="authorizationEndpoint", client_id="clientId", issuer="issuer", token_endpoint="tokenEndpoint", user_info_endpoint="userInfoEndpoint", # the properties below are optional authentication_request_extra_params={ "authentication_request_extra_params_key": "authenticationRequestExtraParams" }, client_secret="clientSecret", on_unauthenticated_request="onUnauthenticatedRequest", scope="scope", session_cookie_name="sessionCookieName", session_timeout="sessionTimeout", use_existing_client_secret=False )
Attributes
-
authentication_request_extra_params
¶ The query parameters (up to 10) to include in the redirect request to the authorization endpoint.
The authorization endpoint of the IdP.
This must be a full URL, including the HTTPS protocol, the domain, and the path.
-
client_id
¶ The OAuth 2.0 client identifier.
-
client_secret
¶ The OAuth 2.0 client secret. This parameter is required if you are creating a rule. If you are modifying a rule, you can omit this parameter if you set
UseExistingClientSecret
to true.
-
issuer
¶ The OIDC issuer identifier of the IdP.
This must be a full URL, including the HTTPS protocol, the domain, and the path.
-
on_unauthenticated_request
¶ .
deny `` - Return an HTTP 401 Unauthorized error.
allow `` - Allow the request to be forwarded to the target.
authenticate `` - Redirect the request to the IdP authorization endpoint. This is the default value.
- Link
- Type
The behavior if the user is not authenticated. The following are possible values
- Return type
Optional
[str
]
-
scope
¶ The set of user claims to be requested from the IdP. The default is
openid
.To verify which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP.
The name of the cookie used to maintain session information.
The default is AWSELBAuthSessionCookie.
-
session_timeout
¶ The maximum duration of the authentication session, in seconds.
The default is 604800 seconds (7 days).
-
token_endpoint
¶ The token endpoint of the IdP.
This must be a full URL, including the HTTPS protocol, the domain, and the path.
-
use_existing_client_secret
¶ CfnListener.AuthenticateOidcConfigProperty.UseExistingClientSecret
.
-
user_info_endpoint
¶ The user info endpoint of the IdP.
This must be a full URL, including the HTTPS protocol, the domain, and the path.
CertificateProperty¶
-
class
CfnListener.
CertificateProperty
(*, certificate_arn=None)¶ Bases:
object
Specifies an SSL server certificate to use as the default certificate for a secure listener.
- Parameters
certificate_arn (
Optional
[str
]) – The Amazon Resource Name (ARN) of the certificate.- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 certificate_property = elbv2.CfnListener.CertificateProperty( certificate_arn="certificateArn" )
Attributes
-
certificate_arn
¶ The Amazon Resource Name (ARN) of the certificate.
FixedResponseConfigProperty¶
-
class
CfnListener.
FixedResponseConfigProperty
(*, status_code, content_type=None, message_body=None)¶ Bases:
object
Specifies information required when returning a custom HTTP response.
- Parameters
status_code (
str
) – The HTTP response code (2XX, 4XX, or 5XX).content_type (
Optional
[str
]) – The content type. Valid Values: text/plain | text/css | text/html | application/javascript | application/jsonmessage_body (
Optional
[str
]) – The message.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 fixed_response_config_property = elbv2.CfnListener.FixedResponseConfigProperty( status_code="statusCode", # the properties below are optional content_type="contentType", message_body="messageBody" )
Attributes
-
content_type
¶ The content type.
Valid Values: text/plain | text/css | text/html | application/javascript | application/json
-
message_body
¶ The message.
-
status_code
¶ The HTTP response code (2XX, 4XX, or 5XX).
ForwardConfigProperty¶
-
class
CfnListener.
ForwardConfigProperty
(*, target_groups=None, target_group_stickiness_config=None)¶ Bases:
object
Information for creating an action that distributes requests among one or more target groups.
For Network Load Balancers, you can specify a single target group. Specify only when
Type
isforward
. If you specify bothForwardConfig
andTargetGroupArn
, you can specify only one target group usingForwardConfig
and it must be the same target group specified inTargetGroupArn
.- Parameters
target_groups (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TargetGroupTupleProperty
,Dict
[str
,Any
]]],None
]) – Information about how traffic will be distributed between multiple target groups in a forward rule.target_group_stickiness_config (
Union
[IResolvable
,TargetGroupStickinessConfigProperty
,Dict
[str
,Any
],None
]) – Information about the target group stickiness for a rule.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 forward_config_property = elbv2.CfnListener.ForwardConfigProperty( target_groups=[elbv2.CfnListener.TargetGroupTupleProperty( target_group_arn="targetGroupArn", weight=123 )], target_group_stickiness_config=elbv2.CfnListener.TargetGroupStickinessConfigProperty( duration_seconds=123, enabled=False ) )
Attributes
-
target_group_stickiness_config
¶ Information about the target group stickiness for a rule.
-
target_groups
¶ Information about how traffic will be distributed between multiple target groups in a forward rule.
RedirectConfigProperty¶
-
class
CfnListener.
RedirectConfigProperty
(*, status_code, host=None, path=None, port=None, protocol=None, query=None)¶ Bases:
object
Information about a redirect action.
A URI consists of the following components: protocol://hostname:port/path?query. You must modify at least one of the following components to avoid a redirect loop: protocol, hostname, port, or path. Any components that you do not modify retain their original values.
You can reuse URI components using the following reserved keywords:
#{protocol}
#{host}
#{port}
#{path} (the leading “/” is removed)
#{query}
For example, you can change the path to “/new/#{path}”, the hostname to “example.#{host}”, or the query to “#{query}&value=xyz”.
- Parameters
status_code (
str
) – The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary (HTTP 302).host (
Optional
[str
]) – The hostname. This component is not percent-encoded. The hostname can contain #{host}.path (
Optional
[str
]) – The absolute path, starting with the leading “/”. This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}.port (
Optional
[str
]) – The port. You can specify a value from 1 to 65535 or #{port}.protocol (
Optional
[str
]) – The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You cannot redirect HTTPS to HTTP.query (
Optional
[str
]) – The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading “?”, as it is automatically added. You can specify any of the reserved keywords.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 redirect_config_property = elbv2.CfnListener.RedirectConfigProperty( status_code="statusCode", # the properties below are optional host="host", path="path", port="port", protocol="protocol", query="query" )
Attributes
-
host
¶ The hostname.
This component is not percent-encoded. The hostname can contain #{host}.
-
path
¶ The absolute path, starting with the leading “/”.
This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}.
-
port
¶ The port.
You can specify a value from 1 to 65535 or #{port}.
-
protocol
¶ The protocol.
You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You cannot redirect HTTPS to HTTP.
-
query
¶ The query parameters, URL-encoded when necessary, but not percent-encoded.
Do not include the leading “?”, as it is automatically added. You can specify any of the reserved keywords.
-
status_code
¶ The HTTP redirect code.
The redirect is either permanent (HTTP 301) or temporary (HTTP 302).
TargetGroupStickinessConfigProperty¶
-
class
CfnListener.
TargetGroupStickinessConfigProperty
(*, duration_seconds=None, enabled=None)¶ Bases:
object
Information about the target group stickiness for a rule.
- Parameters
duration_seconds (
Union
[int
,float
,None
]) – The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days).enabled (
Union
[bool
,IResolvable
,None
]) – Indicates whether target group stickiness is enabled.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 target_group_stickiness_config_property = elbv2.CfnListener.TargetGroupStickinessConfigProperty( duration_seconds=123, enabled=False )
Attributes
-
duration_seconds
¶ The time period, in seconds, during which requests from a client should be routed to the same target group.
The range is 1-604800 seconds (7 days).
-
enabled
¶ Indicates whether target group stickiness is enabled.
TargetGroupTupleProperty¶
-
class
CfnListener.
TargetGroupTupleProperty
(*, target_group_arn=None, weight=None)¶ Bases:
object
Information about how traffic will be distributed between multiple target groups in a forward rule.
- Parameters
target_group_arn (
Optional
[str
]) – The Amazon Resource Name (ARN) of the target group.weight (
Union
[int
,float
,None
]) – The weight. The range is 0 to 999.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_elasticloadbalancingv2 as elbv2 target_group_tuple_property = elbv2.CfnListener.TargetGroupTupleProperty( target_group_arn="targetGroupArn", weight=123 )
Attributes
-
target_group_arn
¶ The Amazon Resource Name (ARN) of the target group.
-
weight
¶ The weight.
The range is 0 to 999.