gridscale / terraform-provider-gridscale

Terraform gridscale provider
https://registry.terraform.io/providers/gridscale/gridscale/latest/docs
Mozilla Public License 2.0
12 stars 11 forks source link

How to attach server to security zone #61

Closed fabiante closed 4 years ago

fabiante commented 4 years ago

Hi,

small question: how to attach a security zone network to a server?

This does not work:

resource "gridscale_server" "server" {
  name = "server"
  cores = 2
  memory = 4
  storage {
    object_uuid = gridscale_storage.server.id
  }
  network {
    object_uuid = gridscale_paas_securityzone.internal.id
    bootdevice = false
  }
  power = true
}

resource "gridscale_paas_securityzone" "internal" {
  name = "internal"
}

This is the resulting error:

Error: update server (bb9033a6-6a0f-4477-9bdf-eb97312affbc) resource - error: Error waiting for network (a589376f-21cf-4858-8cd8-3cd36baddf5c) to be attached to server (bb9033a6-6a0f-4477-9bdf-eb97312affbc): Status code: 404. Error: {'type': 'HTTPError', 'status_code': 404, 'message': "(404, 'Network-type object a589376f-21cf-4858-8cd8-3cd36baddf5c does not exist.')"}. Request UUID: 34187845-7dd4-48b2-8626-5353b1ed834d. 

  on server.tf line 1, in resource "gridscale_server" "server":
   1: resource "gridscale_server" "server" {
nvthongswansea commented 4 years ago

This should work :D

resource "gridscale_server" "server" {
  name = "server"
  cores = 2
  memory = 4
  storage {
    object_uuid = gridscale_storage.server.id
  }
  network {
    object_uuid = gridscale_paas_securityzone.internal.network_uuid
    bootdevice = false
  }
  power = true
}
bkircher commented 4 years ago

@FabianTe feel free to re-open on any follow up questions

fabiante commented 4 years ago

Sorry, forgot to answer. Thanks

bkircher commented 4 years ago

No worries. Just doing the usual spring cleaning :wink: