Skip to content

set_ip_address_type async

set_ip_address_type(
    *,
    config_overrides: Optional[AsyncElasticLoadBalancingv2ClientConfig] = None,
    load_balancer_arn: Optional[LoadBalancerArn] = None,
    ip_address_type: Optional[IpAddressType] = None,
) -> SetIpAddressTypeOutput

Sets the type of IP addresses used by the subnets of the specified load balancer.

Parameters:

  • load_balancer_arn (Optional[LoadBalancerArn], default: None ) –

    The Amazon Resource Name (ARN) of the load balancer.

  • ip_address_type (Optional[IpAddressType], default: None ) –

    The IP address type. Internal load balancers must use ipv4.

    [Application Load Balancers] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-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 are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).

Raises:

Source code in docs_src/capo_elastic_load_balancing_v2/_services/async_elastic_load_balancingv2.py
async def set_ip_address_type(
    self,
    *,
    config_overrides: Optional[AsyncElasticLoadBalancingv2ClientConfig] = None,
    load_balancer_arn: Optional[
        "capo_elastic_load_balancing_v2.types.load_balancer_arn.LoadBalancerArn"
    ] = None,
    ip_address_type: Optional[
        "capo_elastic_load_balancing_v2.types.ip_address_type.IpAddressType"
    ] = None,
) -> "capo_elastic_load_balancing_v2.types.set_ip_address_type_output.SetIpAddressTypeOutput":
    """<p>Sets the type of IP addresses used by the subnets of the specified load balancer.</p>

    Args:
        load_balancer_arn: <p>The Amazon Resource Name (ARN) of the load balancer.</p>
        ip_address_type: <p>The IP address type. Internal load balancers must use <code>ipv4</code>.</p> <p>[Application Load Balancers] The possible values are <code>ipv4</code> (IPv4 addresses), <code>dualstack</code> (IPv4 and IPv6 addresses), and <code>dualstack-without-public-ipv4</code> (public IPv6 addresses and private IPv4 and IPv6 addresses).</p> <p>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.</p> <p>[Network Load Balancers and Gateway Load Balancers] The possible values are <code>ipv4</code> (IPv4 addresses) and <code>dualstack</code> (IPv4 and IPv6 addresses).</p>

    Raises:
        capo_elastic_load_balancing_v2.errors.invalid_configuration_request_exception.InvalidConfigurationRequestException: <p>The requested configuration is not valid.</p>
        capo_elastic_load_balancing_v2.errors.invalid_subnet_exception.InvalidSubnetException: <p>The specified subnet is out of available addresses.</p>
        capo_elastic_load_balancing_v2.errors.load_balancer_not_found_exception.LoadBalancerNotFoundException: <p>The specified load balancer does not exist.</p>
        capo_elastic_load_balancing_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elastic_load_balancing_v2.types.set_ip_address_type_input.SetIpAddressTypeInput]",
    ) -> AsyncOperationResponse[
        "capo_elastic_load_balancing_v2.types.set_ip_address_type_output.SetIpAddressTypeOutput"
    ]:
        import capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.set_ip_address_type

        (
            output,
            http_response,
        ) = await capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.set_ip_address_type.async_set_ip_address_type(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SetIpAddressType")
    )
    input_: capo_elastic_load_balancing_v2.types.set_ip_address_type_input.SetIpAddressTypeInput = {}
    if load_balancer_arn is not None:
        input_["load_balancer_arn"] = load_balancer_arn
    if ip_address_type is not None:
        input_["ip_address_type"] = ip_address_type

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output