Terraform cant create volumes

April 12, 2019 345 views
Terraform API Automated Setups

I am trying to spin up a volume via terraform to attach to droplets that terraform creates. Droplet creation works fine hence provider settings are correct, but volume creation constantly fails with no indication of why in the generated error

digitalocean_volume.glusterStore1: Creating...
  description:             "" => "Gluster Brick Storage - Server01"
  droplet_ids.#:           "" => "<computed>"
  filesystem_label:        "" => "<computed>"
  filesystem_type:         "" => "<computed>"
  initial_filesystem_type: "" => "xfs"
  name:                    "" => "glusterStore1"
  region:                  "" => "SFO2"
  size:                    "" => "25"

Error: Error applying plan:

1 error(s) occurred:

* digitalocean_volume.glusterStore1: 1 error(s) occurred:

* digitalocean_volume.glusterStore1: Error creating Volume: POST https://api.digitalocean.com/v2/volumes: 422 (request "XXXXX") failed to create volume

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Anyone have any idea why its failing?

1 Answer

Greetings!

Great question, thank you for posting it here. I ran this by one of our engineers, Sebastian, and he was able to locate the issue in this case. It seems that the actual error on our side was "invalid region name." It seems that it may need to be "sfo2" instead of "SFO2" and I'll be honest, I would not have caught that. I hope that helps!

Jarland

Have another answer? Share your knowledge.