Deleting an internal IP address
Before deleting a reserved IP address, you should release it by deleting the resource it is assigned to.
If deletion protection is on for the address, disable it before deleting.
- In the management console
, navigate to the folder containing the address. - Navigate
to Virtual Private Cloud. - In the left-hand panel, select
Subnets. - Select the subnet containing the reserved address.
- Navigate to the
IP addresses tab. - Next to the IP address you want to delete, click
and select Delete.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
See the description of the CLI command for deleting an address:
yc vpc address delete --help -
Get a list of addresses in the default folder:
yc vpc address listResult:
+----------------------+---------------------+----------------+----------+-------+ | ID | NAME | ADDRESS | RESERVED | USED | +----------------------+---------------------+----------------+----------+-------+ | e9b6un9gkso6******** | my-internal-address | 192.168.0.10 | true | false | +----------------------+---------------------+----------------+----------+-------+ -
Delete the address by specifying its ID or name:
yc vpc address delete <address_ID_or_name>
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the guides on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
To delete an internal IP address created with Terraform:
-
Open the Terraform configuration file and delete the fragment with the internal IP address description.
Example of an internal IP address description in a Terraform configuration:
... resource "yandex_vpc_address" "internal_addr" { name = "<address_name>" folder_id = "<folder_ID>" internal_ipv4_address { subnet_id = "<subnet_ID>" } } ... -
In the command line, go to the directory with the Terraform configuration file.
-
Check the configuration using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm changes.You can check the update using the management console
or this CLI command:yc vpc address list
To delete an internal IP address, use the delete REST API method for the Address resource or the AddressService/Delete gRPC API call, and provide in the request the ID of the IP address you are deleting in addressId for REST API, or adress_id for gRPC API.
To get the address ID, use the list REST API method for the Address resource or the AddressService/List gRPC API call and provide the folder ID in the folderId parameter for the REST API or folder_id for the gRPC API.
To learn how to find out the folder ID, see Getting the folder ID.