Помогите, пожалуйста, понять как присвоить виртуалке внешний ip.
data "yandex_compute_image" "last_ubuntu" {
family = "ubuntu-2204-lts" # ОС (Ubuntu, 22.04 LTS)
}
resource "yandex_compute_instance" "web" {
name = "prod"
platform_id = "standard-v1" # тип процессора (Intel Broadwell)
resources {
core_fraction = 5 # Гарантированная доля vCPU
cores = 2 # vCPU
memory = 1 # RAM
}
boot_disk {
initialize_params {
image_id = data.yandex_compute_image.last_ubuntu.id
}
}
network_interface {
subnet_id = yandex_vpc_subnet.test-subnet-a.id
nat = true
nat_ip_address = yandex_vpc_address.addr.id
}
metadata = {
user-data = file("nginx.sh")
}
}
resource "yandex_vpc_network" "test-net" {
name = "test-network"
}
resource "yandex_vpc_subnet" "test-subnet-a" {
v4_cidr_blocks = ["10.3.0.0/16"]
zone = "ru-central1-a"
network_id = "${yandex_vpc_network.test-net.id}"
}
resource "yandex_vpc_address" "addr" {
external_ipv4_address {
zone_id = "ru-central1-a"
}
}
Ошибка: Error: Error while requesting API to create instance: server-request-id = afe30f0d-9efd-400b-b815-eb07acb0c606 server-trace-id = da66a2011c424757:876f1a4d12bf71b5:da66a2011c424757:1 client-request-id = 16aede8e-a4bf-484c-8ea8-7c2ea80903c1 client-trace-id = e80cb92b-c9d6-469d-99c0-e24cc53db91c rpc error: code = InvalidArgument desc = Request validation error: NetworkInterfaceSpecs[0]: PrimaryV4AddressSpec: OneToOneNatSpec: Address: invalid ip address