CfnLoadBalancerPropsMixin
- class aws_cdk.mixins_preview.aws_elasticloadbalancing.mixins.CfnLoadBalancerPropsMixin(props, *, strategy=None)
Bases:
MixinSpecifies a Classic Load Balancer.
If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the DependsOn attribute to declare a dependency on the VPC-gateway attachment.
- See:
- CloudformationResource:
AWS::ElasticLoadBalancing::LoadBalancer
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_elasticloadbalancing import mixins as elasticloadbalancing_mixins # attributes: Any cfn_load_balancer_props_mixin = elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin(elasticloadbalancing_mixins.CfnLoadBalancerMixinProps( access_logging_policy=elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.AccessLoggingPolicyProperty( emit_interval=123, enabled=False, s3_bucket_name="s3BucketName", s3_bucket_prefix="s3BucketPrefix" ), app_cookie_stickiness_policy=[elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.AppCookieStickinessPolicyProperty( cookie_name="cookieName", policy_name="policyName" )], availability_zones=["availabilityZones"], connection_draining_policy=elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.ConnectionDrainingPolicyProperty( enabled=False, timeout=123 ), connection_settings=elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.ConnectionSettingsProperty( idle_timeout=123 ), cross_zone=False, health_check=elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.HealthCheckProperty( healthy_threshold="healthyThreshold", interval="interval", target="target", timeout="timeout", unhealthy_threshold="unhealthyThreshold" ), instances=["instances"], lb_cookie_stickiness_policy=[elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.LBCookieStickinessPolicyProperty( cookie_expiration_period="cookieExpirationPeriod", policy_name="policyName" )], listeners=[elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.ListenersProperty( instance_port="instancePort", instance_protocol="instanceProtocol", load_balancer_port="loadBalancerPort", policy_names=["policyNames"], protocol="protocol", ssl_certificate_id="sslCertificateId" )], load_balancer_name="loadBalancerName", policies=[elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.PoliciesProperty( attributes=[attributes], instance_ports=["instancePorts"], load_balancer_ports=["loadBalancerPorts"], policy_name="policyName", policy_type="policyType" )], scheme="scheme", security_groups=["securityGroups"], subnets=["subnets"], tags=[CfnTag( key="key", value="value" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::ElasticLoadBalancing::LoadBalancer.- Parameters:
props (
Union[CfnLoadBalancerMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['accessLoggingPolicy', 'appCookieStickinessPolicy', 'availabilityZones', 'connectionDrainingPolicy', 'connectionSettings', 'crossZone', 'healthCheck', 'instances', 'lbCookieStickinessPolicy', 'listeners', 'loadBalancerName', 'policies', 'scheme', 'securityGroups', 'subnets', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
AccessLoggingPolicyProperty
- class CfnLoadBalancerPropsMixin.AccessLoggingPolicyProperty(*, emit_interval=None, enabled=None, s3_bucket_name=None, s3_bucket_prefix=None)
Bases:
objectSpecifies where and how access logs are stored for your Classic Load Balancer.
- Parameters:
emit_interval (
Union[int,float,None]) – The interval for publishing the access logs. You can specify an interval of either 5 minutes or 60 minutes. Default: 60 minutesenabled (
Union[bool,IResolvable,None]) – Specifies whether access logs are enabled for the load balancer.s3_bucket_name (
Optional[str]) – The name of the Amazon S3 bucket where the access logs are stored.s3_bucket_prefix (
Optional[str]) – The logical hierarchy you created for your Amazon S3 bucket, for examplemy-bucket-prefix/prod. If the prefix is not provided, the log is placed at the root level of the bucket.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_elasticloadbalancing import mixins as elasticloadbalancing_mixins access_logging_policy_property = elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.AccessLoggingPolicyProperty( emit_interval=123, enabled=False, s3_bucket_name="s3BucketName", s3_bucket_prefix="s3BucketPrefix" )
Attributes
- emit_interval
The interval for publishing the access logs. You can specify an interval of either 5 minutes or 60 minutes.
Default: 60 minutes
- enabled
Specifies whether access logs are enabled for the load balancer.
- s3_bucket_name
The name of the Amazon S3 bucket where the access logs are stored.
- s3_bucket_prefix
The logical hierarchy you created for your Amazon S3 bucket, for example
my-bucket-prefix/prod.If the prefix is not provided, the log is placed at the root level of the bucket.
ConnectionDrainingPolicyProperty
- class CfnLoadBalancerPropsMixin.ConnectionDrainingPolicyProperty(*, enabled=None, timeout=None)
Bases:
objectSpecifies the connection draining settings for your Classic Load Balancer.
- Parameters:
enabled (
Union[bool,IResolvable,None]) – Specifies whether connection draining is enabled for the load balancer.timeout (
Union[int,float,None]) – The maximum time, in seconds, to keep the existing connections open before deregistering the instances.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_elasticloadbalancing import mixins as elasticloadbalancing_mixins connection_draining_policy_property = elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.ConnectionDrainingPolicyProperty( enabled=False, timeout=123 )
Attributes
- enabled
Specifies whether connection draining is enabled for the load balancer.
- timeout
The maximum time, in seconds, to keep the existing connections open before deregistering the instances.
ConnectionSettingsProperty
- class CfnLoadBalancerPropsMixin.ConnectionSettingsProperty(*, idle_timeout=None)
Bases:
objectSpecifies the idle timeout value for your Classic Load Balancer.
- Parameters:
idle_timeout (
Union[int,float,None]) – The time, in seconds, that the connection is allowed to be idle (no data has been sent over the connection) before it is closed by the load balancer.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_elasticloadbalancing import mixins as elasticloadbalancing_mixins connection_settings_property = elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.ConnectionSettingsProperty( idle_timeout=123 )
Attributes
- idle_timeout
The time, in seconds, that the connection is allowed to be idle (no data has been sent over the connection) before it is closed by the load balancer.
HealthCheckProperty
- class CfnLoadBalancerPropsMixin.HealthCheckProperty(*, healthy_threshold=None, interval=None, target=None, timeout=None, unhealthy_threshold=None)
Bases:
objectSpecifies health check settings for your Classic Load Balancer.
- Parameters:
healthy_threshold (
Optional[str]) – The number of consecutive health checks successes required before moving the instance to theHealthystate.interval (
Optional[str]) – The approximate interval, in seconds, between health checks of an individual instance.target (
Optional[str]) – The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. The range of valid ports is one (1) through 65535. TCP is the default, specified as a TCP: port pair, for example “TCP:5000”. In this case, a health check simply attempts to open a TCP connection to the instance on the specified port. Failure to connect within the configured timeout is considered unhealthy. SSL is also specified as SSL: port pair, for example, SSL:5000. For HTTP/HTTPS, you must include a ping path in the string. HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example “HTTP:80/weather/us/wa/seattle”. In this case, a HTTP GET request is issued to the instance on the given port and path. Any answer other than “200 OK” within the timeout period is considered unhealthy. The total length of the HTTP ping target must be 1024 16-bit Unicode characters or less.timeout (
Optional[str]) – The amount of time, in seconds, during which no response means a failed health check. This value must be less than theIntervalvalue.unhealthy_threshold (
Optional[str]) – The number of consecutive health check failures required before moving the instance to theUnhealthystate.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_elasticloadbalancing import mixins as elasticloadbalancing_mixins health_check_property = elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.HealthCheckProperty( healthy_threshold="healthyThreshold", interval="interval", target="target", timeout="timeout", unhealthy_threshold="unhealthyThreshold" )
Attributes
- healthy_threshold
The number of consecutive health checks successes required before moving the instance to the
Healthystate.
- interval
The approximate interval, in seconds, between health checks of an individual instance.
- target
The instance being checked.
The protocol is either TCP, HTTP, HTTPS, or SSL. The range of valid ports is one (1) through 65535.
TCP is the default, specified as a TCP: port pair, for example “TCP:5000”. In this case, a health check simply attempts to open a TCP connection to the instance on the specified port. Failure to connect within the configured timeout is considered unhealthy.
SSL is also specified as SSL: port pair, for example, SSL:5000.
For HTTP/HTTPS, you must include a ping path in the string. HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example “HTTP:80/weather/us/wa/seattle”. In this case, a HTTP GET request is issued to the instance on the given port and path. Any answer other than “200 OK” within the timeout period is considered unhealthy.
The total length of the HTTP ping target must be 1024 16-bit Unicode characters or less.
- timeout
The amount of time, in seconds, during which no response means a failed health check.
This value must be less than the
Intervalvalue.
- unhealthy_threshold
The number of consecutive health check failures required before moving the instance to the
Unhealthystate.
ListenersProperty
- class CfnLoadBalancerPropsMixin.ListenersProperty(*, instance_port=None, instance_protocol=None, load_balancer_port=None, policy_names=None, protocol=None, ssl_certificate_id=None)
Bases:
objectSpecifies a listener for your Classic Load Balancer.
Modifying any property replaces the listener.
- Parameters:
instance_port (
Optional[str]) – The port on which the instance is listening.instance_protocol (
Optional[str]) – The protocol to use for routing traffic to instances: HTTP, HTTPS, TCP, or SSL. If the front-end protocol is TCP or SSL, the back-end protocol must be TCP or SSL. If the front-end protocol is HTTP or HTTPS, the back-end protocol must be HTTP or HTTPS. If there is another listener with the sameInstancePortwhoseInstanceProtocolis secure, (HTTPS or SSL), the listener’sInstanceProtocolmust also be secure. If there is another listener with the sameInstancePortwhoseInstanceProtocolis HTTP or TCP, the listener’sInstanceProtocolmust be HTTP or TCP.load_balancer_port (
Optional[str]) – The port on which the load balancer is listening. On EC2-VPC, you can specify any port from the range 1-65535. On EC2-Classic, you can specify any port from the following list: 25, 80, 443, 465, 587, 1024-65535.policy_names (
Optional[Sequence[str]]) – The names of the policies to associate with the listener.protocol (
Optional[str]) – The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.ssl_certificate_id (
Optional[str]) – The Amazon Resource Name (ARN) of the server certificate.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_elasticloadbalancing import mixins as elasticloadbalancing_mixins listeners_property = elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.ListenersProperty( instance_port="instancePort", instance_protocol="instanceProtocol", load_balancer_port="loadBalancerPort", policy_names=["policyNames"], protocol="protocol", ssl_certificate_id="sslCertificateId" )
Attributes
- instance_port
The port on which the instance is listening.
- instance_protocol
HTTP, HTTPS, TCP, or SSL.
If the front-end protocol is TCP or SSL, the back-end protocol must be TCP or SSL. If the front-end protocol is HTTP or HTTPS, the back-end protocol must be HTTP or HTTPS.
If there is another listener with the same
InstancePortwhoseInstanceProtocolis secure, (HTTPS or SSL), the listener’sInstanceProtocolmust also be secure.If there is another listener with the same
InstancePortwhoseInstanceProtocolis HTTP or TCP, the listener’sInstanceProtocolmust be HTTP or TCP.- See:
- Type:
The protocol to use for routing traffic to instances
- load_balancer_port
The port on which the load balancer is listening.
On EC2-VPC, you can specify any port from the range 1-65535. On EC2-Classic, you can specify any port from the following list: 25, 80, 443, 465, 587, 1024-65535.
- policy_names
The names of the policies to associate with the listener.
- protocol
HTTP, HTTPS, TCP, or SSL.
- See:
- Type:
The load balancer transport protocol to use for routing
- ssl_certificate_id
The Amazon Resource Name (ARN) of the server certificate.
PoliciesProperty
- class CfnLoadBalancerPropsMixin.PoliciesProperty(*, attributes=None, instance_ports=None, load_balancer_ports=None, policy_name=None, policy_type=None)
Bases:
objectSpecifies policies for your Classic Load Balancer.
To associate policies with a listener, use the PolicyNames property for the listener.
- Parameters:
attributes (
Union[Sequence[Any],IResolvable,None]) – The policy attributes.instance_ports (
Optional[Sequence[str]]) – The instance ports for the policy. Required only for some policy types.load_balancer_ports (
Optional[Sequence[str]]) – The load balancer ports for the policy. Required only for some policy types.policy_name (
Optional[str]) – The name of the policy.policy_type (
Optional[str]) – The name of the policy type.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_elasticloadbalancing import mixins as elasticloadbalancing_mixins # attributes: Any policies_property = elasticloadbalancing_mixins.CfnLoadBalancerPropsMixin.PoliciesProperty( attributes=[attributes], instance_ports=["instancePorts"], load_balancer_ports=["loadBalancerPorts"], policy_name="policyName", policy_type="policyType" )
Attributes
- attributes
The policy attributes.
- instance_ports
The instance ports for the policy.
Required only for some policy types.
- load_balancer_ports
The load balancer ports for the policy.
Required only for some policy types.
- policy_name
The name of the policy.
- policy_type
The name of the policy type.