Getting information about an IP address
- In the management console
, select the folder containing the address. - Select Virtual Private Cloud.
- In the left-hand panel, select
IP addresses. - The page that opens will display detailed information about all the available addresses.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI command to get information about an address:
yc vpc address get --help
-
Get information about your address by specifying its name or ID:
yc vpc address get <address_name>
Result:
id: e2lot532vpte******** folder_id: b1go3el0d8fs******** created_at: "2024-03-05T09:53:21Z" external_ipv4_address: address: 84.201.***.*** zone_id: ru-central1-b requirements: {} used: true type: EXTERNAL ip_version: IPV4
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the documentation on the Terraform
If you do not have Terraform yet, install it and configure its Yandex Cloud provider.
To get information about an address using Terraform:
-
Add the
data
andoutput
sections to the Terraform configuration file:data "yandex_vpc_address" "my_addr" { address_id = "<address_name>" } output "addr" { value = data.yandex_vpc_address.my_addr.external_ipv4_address }
Where:
data "yandex_vpc_address"
: Description of the address as a data source:address_id
: Address name or ID.
output "addr"
: Output variable containing information about the IP address:value
: Returned value.
You can replace
external_ipv4_address
with any other parameter to get the information you need. For more information about theyandex_vpc_address
data source parameters, see the relevant provider documentation . -
Create resources:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct 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
You will see a detailed list of resources. No changes will be made at this step. Terraform will show any errors found in your configuration.
-
Apply the changes:
terraform apply
-
Type
yes
and press Enter to confirm the changes.
Terraform will create all the required resources and display the output variable values in the terminal. To check the results, run this command:
terraform output
Result:
addr = tolist([ { "address" = "84.201.***.***" "ddos_protection_provider" = "" "outgoing_smtp_capability" = "" "zone_id" = "ru-central1-b" }, ])
-
To get detailed information about an address, use the get REST API method for the Address resource or the AddressService/Get gRPC API call.