у неё был постоянный статический айпи адрес, compute.tf выглядит так
resource "google_compute_address" "static" {
name = "ipv4-address"
}
resource "google_compute_instance" "test-01" {
name = "test-01"
machine_type = "e2-small" # gcloud compute machine-types list
zone = "${var.region}"
allow_stopping_for_update = true
boot_disk {
initialize_params {
image = "centos-7-v20211028" # gcloud compute images list
size = "30"
}
}
metadata = {
ssh-keys = "MY_PUBLIC_SSH_KEY"
}
network_interface {
access_config {
nat_ip = google_compute_address.static.address
}
}
}
Получаю следующую ошибку.
│ with google_compute_address.static,
│ on compute.tf line 1, in resource "google_compute_address" "static":
│ 1: resource "google_compute_address" "static" {
что не так?
возможно ли это из - за того что машина уже создана и я просто дописал ей ресурс и поменял сеть?
Вы как будто опять показываете не ошибку, а только место её возникновения. Что значит "дописал ей ресурс"?
Извиняюсь, а каким образом показать саму ошибку? По поводу ресурса: Ну до этого, не было вообще строчки resource "google_compute_address" "static" { name = "ipv4-address" }
А, просто создали ресурс. А сама ошибка — строчки выше или ниже того, что вы скопировали
Я не особо понимаю, но после terraform apply И после подтверждения yes Вижу следующее (скриншот), откуда еще могу взять ошибку?
+ resource "google_compute_address" "static" { + address = (known after apply) + address_type = "EXTERNAL" + creation_timestamp = (known after apply) + id = (known after apply) + name = "ipv4-address" + network_tier = (known after apply) + project = (known after apply) + purpose = (known after apply) + region = (known after apply) + self_link = (known after apply) + subnetwork = (known after apply) + users = (known after apply) } # google_compute_instance.test-01 will be updated in-place ~ resource "google_compute_instance" "test-01" { id = "projects/project_name/zones/europe-west1-c/instances/test-01" name = "test-01" tags = [] # (18 unchanged attributes hidden) ~ network_interface { name = "nic0" # (6 unchanged attributes hidden) ~ access_config { ~ nat_ip = "XX.XXX.XXX.XXX" -> (known after apply) # (1 unchanged attribute hidden) } } # (3 unchanged blocks hidden) }
Вот сейчас у себя встретил - после Error: в той же строке должна идти ошибка. У вас она почему-то пустая... terraform init -upgrade попробуйте?..
такая же беда. может что - то надо дописать, в output.tf?
Приветствую. Руки добрались. Но вот такая ошибка в данный момент 2021-12-30T12:52:51.052+0600 [INFO] provider.terraform-provider-google_v4.5.0_x5: 2021/12/30 12:52:51 [DEBUG] Retry Transport: Stopping retries, last request was successful: timestamp=2021-12-30T12:52:51.051+0600 2021-12-30T12:52:51.052+0600 [INFO] provider.terraform-provider-google_v4.5.0_x5: 2021/12/30 12:52:51 [DEBUG] Retry Transport: Returning after 1 attempts: timestamp=2021-12-30T12:52:51.051+0600 2021-12-30T12:52:51.053+0600 [TRACE] maybeTainted: google_compute_instance.instance encountered an error during creation, so it is now marked as tainted 2021-12-30T12:52:51.053+0600 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for google_compute_instance.instance 2021-12-30T12:52:51.053+0600 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for google_compute_instance.instance 2021-12-30T12:52:51.053+0600 [TRACE] evalApplyProvisioners: google_compute_instance.instance is tainted, so skipping provisioning 2021-12-30T12:52:51.053+0600 [TRACE] maybeTainted: google_compute_instance.instance was already tainted, so nothing to do 2021-12-30T12:52:51.053+0600 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for google_compute_instance.instance 2021-12-30T12:52:51.053+0600 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for google_compute_instance.instance 2021-12-30T12:52:51.054+0600 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old 2021-12-30T12:52:51.054+0600 [TRACE] statemgr.Filesystem: no state changes since last snapshot 2021-12-30T12:52:51.054+0600 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate 2021-12-30T12:52:51.096+0600 [TRACE] vertex "google_compute_instance.instance": visit complete 2021-12-30T12:52:51.096+0600 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping 2021-12-30T12:52:51.096+0600 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/hashicorp/google\"] (close)" errored, so skipping 2021-12-30T12:52:51.096+0600 [TRACE] dag/walk: upstream of "root" errored, so skipping 2021-12-30T12:52:51.096+0600 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old 2021-12-30T12:52:51.096+0600 [TRACE] statemgr.Filesystem: no state changes since last snapshot 2021-12-30T12:52:51.096+0600 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate 2021-12-30T12:52:51.139+0600 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info 2021-12-30T12:52:51.139+0600 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock 2021-12-30T12:52:51.140+0600 [DEBUG] provider.terraform-provider-google_v4.5.0_x5: 2021/12/30 12:52:51 [DEBUG] [transport] transport: http2Server.HandleStreams failed to read frame: read unix /tmp/plugin132788605->@: use of closed network connection 2021-12-30T12:52:51.140+0600 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" 2021-12-30T12:52:51.143+0600 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.5.0/linux_amd64/terraform-provider-google_v4.5.0_x5 pid=14746 2021-12-30T12:52:51.143+0600 [DEBUG] provider: plugin exited
Обсуждают сегодня