Deleting a static public IP address
Alert
Before deleting a static IP, you should release it by deleting the resource it is attached to.
If deletion protection is enabled for the IP address, disable it first.
You cannot restore an address after it is deleted.
- In the management console
, go to the folder you need to delete a static address from. - In the list of services, select Virtual Private Cloud.
- In the left-hand panel, select
IP addresses. - Click
in the row with the IP address:- Select
Delete. - (Optional) Select
Disable deletion protection if protection is enabled, and click Disable.
- Select
- In the window that opens, confirm by clicking Delete.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI delete address command:
yc vpc address delete --help
-
Get a list of addresses in the default folder:
yc vpc address list
Result:
+----------------------+------+----------------+----------+-------+ | ID | NAME | ADDRESS | RESERVED | USED | +----------------------+------+----------------+----------+-------+ | e9b6un9gkso6******** | | 178.154.253.52 | true | false | +----------------------+------+----------------+----------+-------+
-
Delete the address by specifying its ID:
yc vpc address delete e9b6un9gkso6********
Terraform
For more information about the provider resources, see the documentation on the Terraform
If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.
If you don't have Terraform, install it and configure the Yandex Cloud provider.
To delete a static public IP address created with Terraform:
-
Open the Terraform configuration file and delete the fragment with the static public IP description.
Sample description of a static public IP address in the Terraform configuration:
... resource "yandex_vpc_address" "addr" { name = "exampleAddress" external_ipv4_address { zone_id = "ru-central1-a" } } ...
-
In the command line, go to the directory with the Terraform configuration file.
-
Check the configuration using this command:
terraform validate
If the configuration is correct, you will get this message:
Success! The configuration is valid.
-
Run this command:
terraform plan
The terminal will display a list of resources with parameters. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
into the terminal and press Enter.You can check the update using the management console
or this CLI command:yc vpc address list
To delete a static IP address, use the delete REST API method for the Address resource or the AddressService/Delete gRPC API call, and provide the ID of the IP address you are deleting in the addressId
request parameter.
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
request parameter.
To learn how to find out the folder ID, see Getting the folder ID.