CfnLoadBalancer
- class aws_cdk.aws_elasticloadbalancing.CfnLoadBalancer(scope, id, *, listeners, access_logging_policy=None, app_cookie_stickiness_policy=None, availability_zones=None, connection_draining_policy=None, connection_settings=None, cross_zone=None, health_check=None, instances=None, lb_cookie_stickiness_policy=None, load_balancer_name=None, policies=None, scheme=None, security_groups=None, subnets=None, tags=None)
Bases:
CfnResource
A CloudFormation
AWS::ElasticLoadBalancing::LoadBalancer
.Specifies a Classic Load Balancer.
You can specify the
AvailabilityZones
orSubnets
property, but not both.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.
- CloudformationResource:
AWS::ElasticLoadBalancing::LoadBalancer
- Link:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html
- 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_elasticloadbalancing as elb # attributes: Any cfn_load_balancer = elb.CfnLoadBalancer(self, "MyCfnLoadBalancer", listeners=[elb.CfnLoadBalancer.ListenersProperty( instance_port="instancePort", load_balancer_port="loadBalancerPort", protocol="protocol", # the properties below are optional instance_protocol="instanceProtocol", policy_names=["policyNames"], ssl_certificate_id="sslCertificateId" )], # the properties below are optional access_logging_policy=elb.CfnLoadBalancer.AccessLoggingPolicyProperty( enabled=False, s3_bucket_name="s3BucketName", # the properties below are optional emit_interval=123, s3_bucket_prefix="s3BucketPrefix" ), app_cookie_stickiness_policy=[elb.CfnLoadBalancer.AppCookieStickinessPolicyProperty( cookie_name="cookieName", policy_name="policyName" )], availability_zones=["availabilityZones"], connection_draining_policy=elb.CfnLoadBalancer.ConnectionDrainingPolicyProperty( enabled=False, # the properties below are optional timeout=123 ), connection_settings=elb.CfnLoadBalancer.ConnectionSettingsProperty( idle_timeout=123 ), cross_zone=False, health_check=elb.CfnLoadBalancer.HealthCheckProperty( healthy_threshold="healthyThreshold", interval="interval", target="target", timeout="timeout", unhealthy_threshold="unhealthyThreshold" ), instances=["instances"], lb_cookie_stickiness_policy=[elb.CfnLoadBalancer.LBCookieStickinessPolicyProperty( cookie_expiration_period="cookieExpirationPeriod", policy_name="policyName" )], load_balancer_name="loadBalancerName", policies=[elb.CfnLoadBalancer.PoliciesProperty( attributes=[attributes], policy_name="policyName", policy_type="policyType", # the properties below are optional instance_ports=["instancePorts"], load_balancer_ports=["loadBalancerPorts"] )], scheme="scheme", security_groups=["securityGroups"], subnets=["subnets"], tags=[CfnTag( key="key", value="value" )] )
Create a new
AWS::ElasticLoadBalancing::LoadBalancer
.- Parameters:
scope (
Construct
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
listeners (
Union
[IResolvable
,Sequence
[Union
[ListenersProperty
,Dict
[str
,Any
],IResolvable
]]]) – The listeners for the load balancer. You can specify at most one listener per port. If you update the properties for a listener, AWS CloudFormation deletes the existing listener and creates a new one with the specified properties. While the new listener is being created, clients cannot connect to the load balancer.access_logging_policy (
Union
[IResolvable
,AccessLoggingPolicyProperty
,Dict
[str
,Any
],None
]) – Information about where and how access logs are stored for the load balancer.app_cookie_stickiness_policy (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,AppCookieStickinessPolicyProperty
,Dict
[str
,Any
]]],None
]) – Information about a policy for application-controlled session stickiness.availability_zones (
Optional
[Sequence
[str
]]) – The Availability Zones for the load balancer. For load balancers in a VPC, specifySubnets
instead. Update requires replacement if you did not previously specify an Availability Zone or if you are removing all Availability Zones. Otherwise, update requires no interruption.connection_draining_policy (
Union
[IResolvable
,ConnectionDrainingPolicyProperty
,Dict
[str
,Any
],None
]) – If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance. For more information, see Configure Connection Draining in the Classic Load Balancers Guide .connection_settings (
Union
[IResolvable
,ConnectionSettingsProperty
,Dict
[str
,Any
],None
]) – If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration. By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. For more information, see Configure Idle Connection Timeout in the Classic Load Balancers Guide .cross_zone (
Union
[bool
,IResolvable
,None
]) – If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones. For more information, see Configure Cross-Zone Load Balancing in the Classic Load Balancers Guide .health_check (
Union
[IResolvable
,HealthCheckProperty
,Dict
[str
,Any
],None
]) – The health check settings to use when evaluating the health of your EC2 instances. Update requires replacement if you did not previously specify health check settings or if you are removing the health check settings. Otherwise, update requires no interruption.instances (
Optional
[Sequence
[str
]]) – The IDs of the instances for the load balancer.lb_cookie_stickiness_policy (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LBCookieStickinessPolicyProperty
,Dict
[str
,Any
]]],None
]) – Information about a policy for duration-based session stickiness.load_balancer_name (
Optional
[str
]) – The name of the load balancer. This name must be unique within your set of load balancers for the region. If you don’t specify a name, AWS CloudFormation generates a unique physical ID for the load balancer. For more information, see Name Type . If you specify a name, you cannot perform updates that require replacement of this resource, but you can perform other updates. To replace the resource, specify a new name.policies (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,PoliciesProperty
,Dict
[str
,Any
]]],None
]) – The policies defined for your Classic Load Balancer. Specify only back-end server policies.scheme (
Optional
[str
]) – The type of load balancer. Valid only for load balancers in a VPC. IfScheme
isinternet-facing
, the load balancer has a public DNS name that resolves to a public IP address. IfScheme
isinternal
, the load balancer has a public DNS name that resolves to a private IP address.security_groups (
Optional
[Sequence
[str
]]) – The security groups for the load balancer. Valid only for load balancers in a VPC.subnets (
Optional
[Sequence
[str
]]) – The IDs of the subnets for the load balancer. You can specify at most one subnet per Availability Zone. Update requires replacement if you did not previously specify a subnet or if you are removing all subnets. Otherwise, update requires no interruption. To update to a different subnet in the current Availability Zone, you must first update to a subnet in a different Availability Zone, then update to the new subnet in the original Availability Zone.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – The tags associated with a load balancer.
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:
- Return type:
None
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.
- 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:
- Return type:
Any
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.
- 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::ElasticLoadBalancing::LoadBalancer'
- access_logging_policy
Information about where and how access logs are stored for the load balancer.
- app_cookie_stickiness_policy
Information about a policy for application-controlled session stickiness.
- attr_canonical_hosted_zone_name
The name of the Route 53 hosted zone that is associated with the load balancer.
Internal-facing load balancers don’t use this value, use
DNSName
instead.- CloudformationAttribute:
CanonicalHostedZoneName
- attr_canonical_hosted_zone_name_id
The ID of the Route 53 hosted zone name that is associated with the load balancer.
- CloudformationAttribute:
CanonicalHostedZoneNameID
- attr_dns_name
The DNS name for the load balancer.
- CloudformationAttribute:
DNSName
- attr_source_security_group_group_name
The name of the security group that you can use as part of your inbound rules for your load balancer’s back-end instances.
- CloudformationAttribute:
SourceSecurityGroup.GroupName
- attr_source_security_group_owner_alias
The owner of the source security group.
- CloudformationAttribute:
SourceSecurityGroup.OwnerAlias
- availability_zones
The Availability Zones for the load balancer. For load balancers in a VPC, specify
Subnets
instead.Update requires replacement if you did not previously specify an Availability Zone or if you are removing all Availability Zones. Otherwise, update requires no interruption.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- connection_draining_policy
If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.
For more information, see Configure Connection Draining in the Classic Load Balancers Guide .
- connection_settings
If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.
By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. For more information, see Configure Idle Connection Timeout in the Classic Load Balancers Guide .
- 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.
- cross_zone
If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.
For more information, see Configure Cross-Zone Load Balancing in the Classic Load Balancers Guide .
- health_check
The health check settings to use when evaluating the health of your EC2 instances.
Update requires replacement if you did not previously specify health check settings or if you are removing the health check settings. Otherwise, update requires no interruption.
- instances
The IDs of the instances for the load balancer.
- lb_cookie_stickiness_policy
Information about a policy for duration-based session stickiness.
- listeners
The listeners for the load balancer. You can specify at most one listener per port.
If you update the properties for a listener, AWS CloudFormation deletes the existing listener and creates a new one with the specified properties. While the new listener is being created, clients cannot connect to the load balancer.
- load_balancer_name
The name of the load balancer.
This name must be unique within your set of load balancers for the region.
If you don’t specify a name, AWS CloudFormation generates a unique physical ID for the load balancer. For more information, see Name Type . If you specify a name, you cannot perform updates that require replacement of this resource, but you can perform other updates. To replace the resource, specify a new name.
- 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)
.- 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.
- policies
The policies defined for your Classic Load Balancer.
Specify only back-end server policies.
- 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 })
.
- scheme
The type of load balancer. Valid only for load balancers in a VPC.
If
Scheme
isinternet-facing
, the load balancer has a public DNS name that resolves to a public IP address.If
Scheme
isinternal
, the load balancer has a public DNS name that resolves to a private IP address.
- security_groups
The security groups for the load balancer.
Valid only for load balancers in a VPC.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- subnets
The IDs of the subnets for the load balancer. You can specify at most one subnet per Availability Zone.
Update requires replacement if you did not previously specify a subnet or if you are removing all subnets. Otherwise, update requires no interruption. To update to a different subnet in the current Availability Zone, you must first update to a subnet in a different Availability Zone, then update to the new subnet in the original Availability Zone.
- tags
The tags associated with a load balancer.
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
AccessLoggingPolicyProperty
- class CfnLoadBalancer.AccessLoggingPolicyProperty(*, enabled, s3_bucket_name, emit_interval=None, s3_bucket_prefix=None)
Bases:
object
Specifies where and how access logs are stored for your Classic Load Balancer.
- Parameters:
enabled (
Union
[bool
,IResolvable
]) – Specifies whether access logs are enabled for the load balancer.s3_bucket_name (
str
) – The name of the Amazon S3 bucket where the access logs are stored.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 minutess3_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.
- 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_elasticloadbalancing as elb access_logging_policy_property = elb.CfnLoadBalancer.AccessLoggingPolicyProperty( enabled=False, s3_bucket_name="s3BucketName", # the properties below are optional emit_interval=123, 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 CfnLoadBalancer.ConnectionDrainingPolicyProperty(*, enabled, timeout=None)
Bases:
object
Specifies the connection draining settings for your Classic Load Balancer.
- Parameters:
enabled (
Union
[bool
,IResolvable
]) – 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.
- 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_elasticloadbalancing as elb connection_draining_policy_property = elb.CfnLoadBalancer.ConnectionDrainingPolicyProperty( enabled=False, # the properties below are optional 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 CfnLoadBalancer.ConnectionSettingsProperty(*, idle_timeout)
Bases:
object
Specifies the idle timeout value for your Classic Load Balancer.
- Parameters:
idle_timeout (
Union
[int
,float
]) – 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.- 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_elasticloadbalancing as elb connection_settings_property = elb.CfnLoadBalancer.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 CfnLoadBalancer.HealthCheckProperty(*, healthy_threshold, interval, target, timeout, unhealthy_threshold)
Bases:
object
Specifies health check settings for your Classic Load Balancer.
- Parameters:
healthy_threshold (
str
) – The number of consecutive health checks successes required before moving the instance to theHealthy
state.interval (
str
) – The approximate interval, in seconds, between health checks of an individual instance.target (
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 (
str
) – The amount of time, in seconds, during which no response means a failed health check. This value must be less than theInterval
value.unhealthy_threshold (
str
) – The number of consecutive health check failures required before moving the instance to theUnhealthy
state.
- 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_elasticloadbalancing as elb health_check_property = elb.CfnLoadBalancer.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
Healthy
state.
- 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
Interval
value.
- unhealthy_threshold
The number of consecutive health check failures required before moving the instance to the
Unhealthy
state.
ListenersProperty
- class CfnLoadBalancer.ListenersProperty(*, instance_port, load_balancer_port, protocol, instance_protocol=None, policy_names=None, ssl_certificate_id=None)
Bases:
object
Specifies a listener for your Classic Load Balancer.
Modifying any property replaces the listener.
- Parameters:
instance_port (
str
) – The port on which the instance is listening.load_balancer_port (
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.protocol (
str
) – The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.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 sameInstancePort
whoseInstanceProtocol
is secure, (HTTPS or SSL), the listener’sInstanceProtocol
must also be secure. If there is another listener with the sameInstancePort
whoseInstanceProtocol
is HTTP or TCP, the listener’sInstanceProtocol
must be HTTP or TCP.policy_names (
Optional
[Sequence
[str
]]) – The names of the policies to associate with the listener.ssl_certificate_id (
Optional
[str
]) – The Amazon Resource Name (ARN) of the server certificate.
- Link:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html
- 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_elasticloadbalancing as elb listeners_property = elb.CfnLoadBalancer.ListenersProperty( instance_port="instancePort", load_balancer_port="loadBalancerPort", protocol="protocol", # the properties below are optional instance_protocol="instanceProtocol", policy_names=["policyNames"], 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
InstancePort
whoseInstanceProtocol
is secure, (HTTPS or SSL), the listener’sInstanceProtocol
must also be secure.If there is another listener with the same
InstancePort
whoseInstanceProtocol
is HTTP or TCP, the listener’sInstanceProtocol
must be HTTP or TCP.- Link:
- 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.
- Link:
- Type:
The load balancer transport protocol to use for routing
- ssl_certificate_id
The Amazon Resource Name (ARN) of the server certificate.
PoliciesProperty
- class CfnLoadBalancer.PoliciesProperty(*, attributes, policy_name, policy_type, instance_ports=None, load_balancer_ports=None)
Bases:
object
Specifies 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
]) – The policy attributes.policy_name (
str
) – The name of the policy.policy_type (
str
) – The name of the policy type.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.
- Link:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html
- 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_elasticloadbalancing as elb # attributes: Any policies_property = elb.CfnLoadBalancer.PoliciesProperty( attributes=[attributes], policy_name="policyName", policy_type="policyType", # the properties below are optional instance_ports=["instancePorts"], load_balancer_ports=["loadBalancerPorts"] )
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.