CfnLoadBalancer
- class aws_cdk.aws_elasticloadbalancingv2.CfnLoadBalancer(scope, id, *, enable_prefix_for_ipv6_source_nat=None, enforce_security_group_inbound_rules_on_private_link_traffic=None, ip_address_type=None, load_balancer_attributes=None, minimum_load_balancer_capacity=None, name=None, scheme=None, security_groups=None, subnet_mappings=None, subnets=None, tags=None, type=None)
Bases:
CfnResource
Specifies an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.
- See:
- CloudformationResource:
AWS::ElasticLoadBalancingV2::LoadBalancer
- 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 import aws_elasticloadbalancingv2 as elbv2 cfn_load_balancer = elbv2.CfnLoadBalancer(self, "MyCfnLoadBalancer", enable_prefix_for_ipv6_source_nat="enablePrefixForIpv6SourceNat", enforce_security_group_inbound_rules_on_private_link_traffic="enforceSecurityGroupInboundRulesOnPrivateLinkTraffic", ip_address_type="ipAddressType", load_balancer_attributes=[elbv2.CfnLoadBalancer.LoadBalancerAttributeProperty( key="key", value="value" )], minimum_load_balancer_capacity=elbv2.CfnLoadBalancer.MinimumLoadBalancerCapacityProperty( capacity_units=123 ), name="name", scheme="scheme", security_groups=["securityGroups"], subnet_mappings=[elbv2.CfnLoadBalancer.SubnetMappingProperty( subnet_id="subnetId", # the properties below are optional allocation_id="allocationId", i_pv6_address="iPv6Address", private_iPv4_address="privateIPv4Address", source_nat_ipv6_prefix="sourceNatIpv6Prefix" )], subnets=["subnets"], tags=[CfnTag( key="key", value="value" )], type="type" )
- Parameters:
scope (
Construct
) – Scope in which this resource is defined.id (
str
) – Construct identifier for this resource (unique in its scope).enable_prefix_for_ipv6_source_nat (
Optional
[str
]) – [Network Load Balancers with UDP listeners] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must bedualstack
. The default value isoff
.enforce_security_group_inbound_rules_on_private_link_traffic (
Optional
[str
]) – Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink . The default ison
.ip_address_type (
Optional
[str
]) – The IP address type. Internal load balancers must useipv4
. [Application Load Balancers] The possible values areipv4
(IPv4 addresses),dualstack
(IPv4 and IPv6 addresses), anddualstack-without-public-ipv4
(public IPv6 addresses and private IPv4 and IPv6 addresses). Application Load Balancer authentication supports IPv4 addresses only when connecting to an Identity Provider (IdP) or Amazon Cognito endpoint. Without a public IPv4 address the load balancer can’t complete the authentication process, resulting in HTTP 500 errors. [Network Load Balancers and Gateway Load Balancers] The possible values areipv4
(IPv4 addresses) anddualstack
(IPv4 and IPv6 addresses).load_balancer_attributes (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LoadBalancerAttributeProperty
,Dict
[str
,Any
]]],None
]) – The load balancer attributes.minimum_load_balancer_capacity (
Union
[IResolvable
,MinimumLoadBalancerCapacityProperty
,Dict
[str
,Any
],None
]) – The minimum capacity for a load balancer.name (
Optional
[str
]) – The name of the load balancer. This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, must not begin or end with a hyphen, and must not begin with “internal-”. If you don’t specify a name, AWS CloudFormation generates a unique physical ID for the load balancer. 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.scheme (
Optional
[str
]) – The nodes of an Internet-facing load balancer have public IP addresses. The DNS name of an Internet-facing load balancer is publicly resolvable to the public IP addresses of the nodes. Therefore, Internet-facing load balancers can route requests from clients over the internet. The nodes of an internal load balancer have only private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the private IP addresses of the nodes. Therefore, internal load balancers can route requests only from clients with access to the VPC for the load balancer. The default is an Internet-facing load balancer. You can’t specify a scheme for a Gateway Load Balancer.security_groups (
Optional
[Sequence
[str
]]) – [Application Load Balancers and Network Load Balancers] The IDs of the security groups for the load balancer.subnet_mappings (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,SubnetMappingProperty
,Dict
[str
,Any
]]],None
]) – The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. [Application Load Balancers] You must specify subnets from at least two Availability Zones. You can’t specify Elastic IP addresses for your subnets. [Application Load Balancers on Outposts] You must specify one Outpost subnet. [Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones. [Network Load Balancers] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet. [Gateway Load Balancers] You can specify subnets from one or more Availability Zones. You can’t specify Elastic IP addresses for your subnets.subnets (
Optional
[Sequence
[str
]]) – The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets. [Application Load Balancers] You must specify subnets from at least two Availability Zones. [Application Load Balancers on Outposts] You must specify one Outpost subnet. [Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones. [Network Load Balancers and Gateway Load Balancers] You can specify subnets from one or more Availability Zones.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – The tags to assign to the load balancer.type (
Optional
[str
]) – The type of load balancer. The default isapplication
.
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_dependency(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_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource
) –- Deprecated:
use addDependency
- Stability:
deprecated
- 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 intermediate 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
). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT
). A list of resources that support this policy can be found in the following link:- 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 resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
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.type_hint (
Optional
[ResolutionTypeHint
]) –
- 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
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List
[Union
[Stack
,CfnResource
]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List
[CfnResource
]
- 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
- remove_dependency(target)
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- 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::LoadBalancer'
- attr_canonical_hosted_zone_id
The ID of the Amazon Route 53 hosted zone associated with the load balancer.
For example,
Z2P70J7EXAMPLE
.- CloudformationAttribute:
CanonicalHostedZoneID
- attr_dns_name
The DNS name for the load balancer.
For example,
my-load-balancer-424835706.us-west-2.elb.amazonaws.com
.- CloudformationAttribute:
DNSName
- attr_load_balancer_arn
The Amazon Resource Name (ARN) of the load balancer.
- CloudformationAttribute:
LoadBalancerArn
- attr_load_balancer_full_name
The full name of the load balancer.
For example,
app/my-load-balancer/50dc6c495c0c9188
.- CloudformationAttribute:
LoadBalancerFullName
- attr_load_balancer_name
The name of the load balancer.
For example,
my-load-balancer
.- CloudformationAttribute:
LoadBalancerName
- attr_security_groups
The IDs of the security groups for the load balancer.
- CloudformationAttribute:
SecurityGroups
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- 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.
- enable_prefix_for_ipv6_source_nat
[Network Load Balancers with UDP listeners] Indicates whether to use an IPv6 prefix from each subnet for source NAT.
- enforce_security_group_inbound_rules_on_private_link_traffic
Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink .
- ip_address_type
The IP address type.
Internal load balancers must use
ipv4
.
- load_balancer_attributes
The load balancer attributes.
- 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.
- minimum_load_balancer_capacity
The minimum capacity for a load balancer.
- name
The name of the load balancer.
- node
The tree node.
- 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 nodes of an Internet-facing load balancer have public IP addresses.
- security_groups
[Application Load Balancers and Network Load Balancers] The IDs of the security groups for the load balancer.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- subnet_mappings
The IDs of the subnets.
- subnets
The IDs of the subnets.
- tags
Tag Manager which manages the tags for this resource.
- tags_raw
The tags to assign to the load balancer.
- type
The type of 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(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
LoadBalancerAttributeProperty
- class CfnLoadBalancer.LoadBalancerAttributeProperty(*, key=None, value=None)
Bases:
object
Specifies an attribute for an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.
- Parameters:
key (
Optional
[str
]) – The name of the attribute. The following attributes are supported by all load balancers: -deletion_protection.enabled
- Indicates whether deletion protection is enabled. The value istrue
orfalse
. The default isfalse
. -load_balancing.cross_zone.enabled
- Indicates whether cross-zone load balancing is enabled. The possible values aretrue
andfalse
. The default for Network Load Balancers and Gateway Load Balancers isfalse
. The default for Application Load Balancers istrue
, and can’t be changed. The following attributes are supported by both Application Load Balancers and Network Load Balancers: -access_logs.s3.enabled
- Indicates whether access logs are enabled. The value istrue
orfalse
. The default isfalse
. -access_logs.s3.bucket
- The name of the S3 bucket for the access logs. This attribute is required if access logs are enabled. The bucket must exist in the same region as the load balancer and have a bucket policy that grants Elastic Load Balancing permissions to write to the bucket. -access_logs.s3.prefix
- The prefix for the location in the S3 bucket for the access logs. -ipv6.deny_all_igw_traffic
- Blocks internet gateway (IGW) access to the load balancer. It is set tofalse
for internet-facing load balancers andtrue
for internal load balancers, preventing unintended access to your internal load balancer through an internet gateway. -zonal_shift.config.enabled
- Indicates whether zonal shift is enabled. The possible values aretrue
andfalse
. The default isfalse
. The following attributes are supported by only Application Load Balancers: -idle_timeout.timeout_seconds
- The idle timeout value, in seconds. The valid range is 1-4000 seconds. The default is 60 seconds. -client_keep_alive.seconds
- The client keep alive value, in seconds. The valid range is 60-604800 seconds. The default is 3600 seconds. -connection_logs.s3.enabled
- Indicates whether connection logs are enabled. The value istrue
orfalse
. The default isfalse
. -connection_logs.s3.bucket
- The name of the S3 bucket for the connection logs. This attribute is required if connection logs are enabled. The bucket must exist in the same region as the load balancer and have a bucket policy that grants Elastic Load Balancing permissions to write to the bucket. -connection_logs.s3.prefix
- The prefix for the location in the S3 bucket for the connection logs. -routing.http.desync_mitigation_mode
- Determines how the load balancer handles requests that might pose a security risk to your application. The possible values aremonitor
,defensive
, andstrictest
. The default isdefensive
. -routing.http.drop_invalid_header_fields.enabled
- Indicates whether HTTP headers with invalid header fields are removed by the load balancer (true
) or routed to targets (false
). The default isfalse
. -routing.http.preserve_host_header.enabled
- Indicates whether the Application Load Balancer should preserve theHost
header in the HTTP request and send it to the target without any change. The possible values aretrue
andfalse
. The default isfalse
. -routing.http.x_amzn_tls_version_and_cipher_suite.enabled
- Indicates whether the two headers (x-amzn-tls-version
andx-amzn-tls-cipher-suite
), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Thex-amzn-tls-version
header has information about the TLS protocol version negotiated with the client, and thex-amzn-tls-cipher-suite
header has information about the cipher suite negotiated with the client. Both headers are in OpenSSL format. The possible values for the attribute aretrue
andfalse
. The default isfalse
. -routing.http.xff_client_port.enabled
- Indicates whether theX-Forwarded-For
header should preserve the source port that the client used to connect to the load balancer. The possible values aretrue
andfalse
. The default isfalse
. -routing.http.xff_header_processing.mode
- Enables you to modify, preserve, or remove theX-Forwarded-For
header in the HTTP request before the Application Load Balancer sends the request to the target. The possible values areappend
,preserve
, andremove
. The default isappend
. - If the value isappend
, the Application Load Balancer adds the client IP address (of the last hop) to theX-Forwarded-For
header in the HTTP request before it sends it to targets. - If the value ispreserve
the Application Load Balancer preserves theX-Forwarded-For
header in the HTTP request, and sends it to targets without any change. - If the value isremove
, the Application Load Balancer removes theX-Forwarded-For
header in the HTTP request before it sends it to targets. -routing.http2.enabled
- Indicates whether HTTP/2 is enabled. The possible values aretrue
andfalse
. The default istrue
. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. -waf.fail_open.enabled
- Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. The possible values aretrue
andfalse
. The default isfalse
. The following attributes are supported by only Network Load Balancers: -dns_record.client_routing_policy
- Indicates how traffic is distributed among the load balancer Availability Zones. The possible values areavailability_zone_affinity
with 100 percent zonal affinity,partial_availability_zone_affinity
with 85 percent zonal affinity, andany_availability_zone
with 0 percent zonal affinity.value (
Optional
[str
]) – The value of the attribute.
- 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 import aws_elasticloadbalancingv2 as elbv2 load_balancer_attribute_property = elbv2.CfnLoadBalancer.LoadBalancerAttributeProperty( key="key", value="value" )
Attributes
- key
The name of the attribute.
The following attributes are supported by all load balancers:
deletion_protection.enabled
- Indicates whether deletion protection is enabled. The value istrue
orfalse
. The default isfalse
.load_balancing.cross_zone.enabled
- Indicates whether cross-zone load balancing is enabled. The possible values aretrue
andfalse
. The default for Network Load Balancers and Gateway Load Balancers isfalse
. The default for Application Load Balancers istrue
, and can’t be changed.
The following attributes are supported by both Application Load Balancers and Network Load Balancers:
access_logs.s3.enabled
- Indicates whether access logs are enabled. The value istrue
orfalse
. The default isfalse
.access_logs.s3.bucket
- The name of the S3 bucket for the access logs. This attribute is required if access logs are enabled. The bucket must exist in the same region as the load balancer and have a bucket policy that grants Elastic Load Balancing permissions to write to the bucket.access_logs.s3.prefix
- The prefix for the location in the S3 bucket for the access logs.ipv6.deny_all_igw_traffic
- Blocks internet gateway (IGW) access to the load balancer. It is set tofalse
for internet-facing load balancers andtrue
for internal load balancers, preventing unintended access to your internal load balancer through an internet gateway.zonal_shift.config.enabled
- Indicates whether zonal shift is enabled. The possible values aretrue
andfalse
. The default isfalse
.
The following attributes are supported by only Application Load Balancers:
idle_timeout.timeout_seconds
- The idle timeout value, in seconds. The valid range is 1-4000 seconds. The default is 60 seconds.client_keep_alive.seconds
- The client keep alive value, in seconds. The valid range is 60-604800 seconds. The default is 3600 seconds.connection_logs.s3.enabled
- Indicates whether connection logs are enabled. The value istrue
orfalse
. The default isfalse
.connection_logs.s3.bucket
- The name of the S3 bucket for the connection logs. This attribute is required if connection logs are enabled. The bucket must exist in the same region as the load balancer and have a bucket policy that grants Elastic Load Balancing permissions to write to the bucket.connection_logs.s3.prefix
- The prefix for the location in the S3 bucket for the connection logs.routing.http.desync_mitigation_mode
- Determines how the load balancer handles requests that might pose a security risk to your application. The possible values aremonitor
,defensive
, andstrictest
. The default isdefensive
.routing.http.drop_invalid_header_fields.enabled
- Indicates whether HTTP headers with invalid header fields are removed by the load balancer (true
) or routed to targets (false
). The default isfalse
.routing.http.preserve_host_header.enabled
- Indicates whether the Application Load Balancer should preserve theHost
header in the HTTP request and send it to the target without any change. The possible values aretrue
andfalse
. The default isfalse
.routing.http.x_amzn_tls_version_and_cipher_suite.enabled
- Indicates whether the two headers (x-amzn-tls-version
andx-amzn-tls-cipher-suite
), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Thex-amzn-tls-version
header has information about the TLS protocol version negotiated with the client, and thex-amzn-tls-cipher-suite
header has information about the cipher suite negotiated with the client. Both headers are in OpenSSL format. The possible values for the attribute aretrue
andfalse
. The default isfalse
.routing.http.xff_client_port.enabled
- Indicates whether theX-Forwarded-For
header should preserve the source port that the client used to connect to the load balancer. The possible values aretrue
andfalse
. The default isfalse
.routing.http.xff_header_processing.mode
- Enables you to modify, preserve, or remove theX-Forwarded-For
header in the HTTP request before the Application Load Balancer sends the request to the target. The possible values areappend
,preserve
, andremove
. The default isappend
.If the value is
append
, the Application Load Balancer adds the client IP address (of the last hop) to theX-Forwarded-For
header in the HTTP request before it sends it to targets.If the value is
preserve
the Application Load Balancer preserves theX-Forwarded-For
header in the HTTP request, and sends it to targets without any change.If the value is
remove
, the Application Load Balancer removes theX-Forwarded-For
header in the HTTP request before it sends it to targets.routing.http2.enabled
- Indicates whether HTTP/2 is enabled. The possible values aretrue
andfalse
. The default istrue
. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens.waf.fail_open.enabled
- Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. The possible values aretrue
andfalse
. The default isfalse
.
The following attributes are supported by only Network Load Balancers:
dns_record.client_routing_policy
- Indicates how traffic is distributed among the load balancer Availability Zones. The possible values areavailability_zone_affinity
with 100 percent zonal affinity,partial_availability_zone_affinity
with 85 percent zonal affinity, andany_availability_zone
with 0 percent zonal affinity.
MinimumLoadBalancerCapacityProperty
- class CfnLoadBalancer.MinimumLoadBalancerCapacityProperty(*, capacity_units)
Bases:
object
The minimum capacity for a load balancer.
- Parameters:
capacity_units (
Union
[int
,float
]) – The number of capacity units.- 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 import aws_elasticloadbalancingv2 as elbv2 minimum_load_balancer_capacity_property = elbv2.CfnLoadBalancer.MinimumLoadBalancerCapacityProperty( capacity_units=123 )
Attributes
SubnetMappingProperty
- class CfnLoadBalancer.SubnetMappingProperty(*, subnet_id, allocation_id=None, i_pv6_address=None, private_i_pv4_address=None, source_nat_ipv6_prefix=None)
Bases:
object
Specifies a subnet for a load balancer.
- Parameters:
subnet_id (
str
) – The ID of the subnet.allocation_id (
Optional
[str
]) – [Network Load Balancers] The allocation ID of the Elastic IP address for an internet-facing load balancer.i_pv6_address (
Optional
[str
]) – [Network Load Balancers] The IPv6 address.private_i_pv4_address (
Optional
[str
]) – [Network Load Balancers] The private IPv4 address for an internal load balancer.source_nat_ipv6_prefix (
Optional
[str
]) – [Network Load Balancers with UDP listeners] The IPv6 prefix to use for source NAT. Specify an IPv6 prefix (/80 netmask) from the subnet CIDR block orauto_assigned
to use an IPv6 prefix selected at random from the subnet CIDR block.
- 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 import aws_elasticloadbalancingv2 as elbv2 subnet_mapping_property = elbv2.CfnLoadBalancer.SubnetMappingProperty( subnet_id="subnetId", # the properties below are optional allocation_id="allocationId", i_pv6_address="iPv6Address", private_iPv4_address="privateIPv4Address", source_nat_ipv6_prefix="sourceNatIpv6Prefix" )
Attributes
- allocation_id
[Network Load Balancers] The allocation ID of the Elastic IP address for an internet-facing load balancer.
- i_pv6_address
[Network Load Balancers] The IPv6 address.
- private_i_pv4_address
[Network Load Balancers] The private IPv4 address for an internal load balancer.
- source_nat_ipv6_prefix
[Network Load Balancers with UDP listeners] The IPv6 prefix to use for source NAT.
Specify an IPv6 prefix (/80 netmask) from the subnet CIDR block or
auto_assigned
to use an IPv6 prefix selected at random from the subnet CIDR block.