set_ip_address_type
¶
set_ip_address_type(
resource_type: ResourceType,
resource_name: ResourceName,
ip_address_type: IpAddressType,
*,
config_overrides: Optional[LightsailClientConfig] = None,
accept_bundle_update: Optional[boolean] = None,
) -> SetIpAddressTypeResult
Sets the IP address type for an Amazon Lightsail resource.
Use this action to enable dual-stack for a resource, which enables IPv4 and IPv6 for the specified resource. Alternately, you can use this action to disable dual-stack, and enable IPv4 only.
Parameters:
-
resource_type(ResourceType) –The resource type.
The resource values are
Distribution,Instance, andLoadBalancer.Distribution-related APIs are available only in the N. Virginia (
us-east-1) Amazon Web Services Region. Set your Amazon Web Services Region configuration tous-east-1to create, view, or edit distributions. -
resource_name(ResourceName) –The name of the resource for which to set the IP address type.
-
ip_address_type(IpAddressType) –The IP address type to set for the specified resource.
The possible values are
ipv4for IPv4 only,ipv6for IPv6 only, anddualstackfor IPv4 and IPv6. -
accept_bundle_update(Optional[boolean], default:None) –Required parameter to accept the instance bundle update when changing to, and from, IPv6-only.
An instance bundle will change when switching from
dual-stackoripv4, toipv6. It also changes when switching fromipv6, todual-stackoripv4.You must include this parameter in the command to update the bundle. For example, if you switch from
dual-stacktoipv6, the bundle will be updated, and billing for the IPv6-only instance bundle begins immediately.
Raises:
-
AccessDeniedException–Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.
-
AccountSetupInProgressException–Lightsail throws this exception when an account is still in the setup in progress state.
-
InvalidInputException–Lightsail throws this exception when user input does not conform to the validation rules of an input field.
Domain and distribution APIs are only available in the N. Virginia (
us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration tous-east-1to create, view, or edit these resources. -
NotFoundException–Lightsail throws this exception when it cannot find a resource.
-
OperationFailureException–Lightsail throws this exception when an operation fails to execute.
-
RegionSetupInProgressException–Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.
-
ServiceException–A general service exception.
-
UnauthenticatedException–Lightsail throws this exception when the user has not been authenticated.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lightsail/_services/lightsail.py
8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 | |