Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/digitalocean: adds a volume resource #7560

Merged
merged 2 commits into from
Jul 13, 2016
Merged

provider/digitalocean: adds a volume resource #7560

merged 2 commits into from
Jul 13, 2016

Conversation

aybabtme
Copy link
Contributor

@aybabtme aybabtme commented Jul 8, 2016

We're currently in beta with a block storage feature we call "volumes". This adds support for volume resources in the DigitalOcean provider.

Usage looks like:

resource "digitalocean_volume" "foobar" {
    region      = "nyc1"
    name        = "ultimate-volume-the-second"
    size        = 100
    description = "peace makes plenty"
}

resource "digitalocean_droplet" "foobar" {
  name       = "baz"
  size       = "1gb"
  image      = "coreos-stable"
  region     = "nyc1"
  volume_ids = ["${digitalocean_volume.foobar.id}"]
}

To support this, I had to bump the vendored digitalocean/godo package. If this results in too much diff noise, I'm happy to send the bump in a separate PR.

cc @nickvanw @jphines @rafaelrosafu @neurodrone @ralfonso

@jen20
Copy link
Contributor

jen20 commented Jul 9, 2016

Hi @aybabtme! Thanks for this, the code looks good. However, running the acceptance test I'm seeing 404s on volumes. Is this something that accounts need configuring for, or is there some kind of eventual consistency we need to take into account for import? For example:

=== RUN   TestAccDigitalOceanVolume_Basic
--- FAIL: TestAccDigitalOceanVolume_Basic (0.32s)
    testing.go:264: Step 0 error: Error applying: 1 error(s) occurred:

        * digitalocean_volume.foobar: Error creating Volume: POST https://api.digitalocean.com/v2/volumes: 404 The resource you were accessing could not be found.
=== RUN   TestAccDigitalOceanVolume_Basic
--- FAIL: TestAccDigitalOceanVolume_Basic (0.32s)
    testing.go:264: Step 0 error: Error applying: 1 error(s) occurred:

        * digitalocean_volume.foobar: Error creating Volume: POST https://api.digitalocean.com/v2/volumes: 404 The resource you were accessing could not be found.
=== RUN   TestAccDigitalOceanVolume_Droplet
--- FAIL: TestAccDigitalOceanVolume_Droplet (0.68s)
    testing.go:264: Step 0 error: Error applying: 1 error(s) occurred:

        * digitalocean_volume.foobar: Error creating Volume: POST https://api.digitalocean.com/v2/volumes: 404 The resource you were accessing could not be found.
FAIL
exit status 1

@aybabtme
Copy link
Contributor Author

aybabtme commented Jul 9, 2016

Hi @jen20, the volume feature is behind a beta flag, if you can share with me your test account ID, I can enable the feature for you.

The test output goes like:

$ make testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanVolume_'
==> Checking that code complies with gofmt requirements...
/Users/antoine/gocode/bin/stringer
go generate $(go list ./... | grep -v /vendor/)
2016/07/07 20:39:55 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanVolume_ -timeout 120m
=== RUN   TestAccDigitalOceanVolume_importBasic
--- PASS: TestAccDigitalOceanVolume_importBasic (5.92s)
=== RUN   TestAccDigitalOceanVolume_Basic
--- PASS: TestAccDigitalOceanVolume_Basic (3.63s)
=== RUN   TestAccDigitalOceanVolume_Droplet
--- PASS: TestAccDigitalOceanVolume_Droplet (43.79s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/digitalocean   53.359s

@jen20
Copy link
Contributor

jen20 commented Jul 10, 2016

Ah, thanks. Is there a good place to email the account ID to, or are they not considered sensitive? This LGTM - the last thing it needs is a docs page - might be worth noting the beta flag until it's rolled out to everyone? Thanks!

@stack72
Copy link
Contributor

stack72 commented Jul 11, 2016

@aybabtme

I just merged the digitalocean_tag resource PR - please can you rebase this PR? :)

P.

@aybabtme
Copy link
Contributor Author

@stack72 I just rebased, PTAL =]

@aybabtme
Copy link
Contributor Author

@jen20 shoot me an email with your user ID at antoine at do.co

@aybabtme
Copy link
Contributor Author

@jen20 @stack72 we just launched it, it's not behind a beta flag anymore =]

@stack72
Copy link
Contributor

stack72 commented Jul 13, 2016

Hi @aybabtme

Thanks for letting us know this is GA - just ran the tests on my own account and got the following:

% make testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanVolume_'                                                                            
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanVolume_ -timeout 120m
=== RUN   TestAccDigitalOceanVolume_importBasic
--- PASS: TestAccDigitalOceanVolume_importBasic (29.78s)
=== RUN   TestAccDigitalOceanVolume_Basic
--- PASS: TestAccDigitalOceanVolume_Basic (5.40s)
=== RUN   TestAccDigitalOceanVolume_Droplet
--- PASS: TestAccDigitalOceanVolume_Droplet (79.34s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/digitalocean   114.529s

Love that you even included an import :)

Merging now!

Paul

@stack72 stack72 merged commit 3d6fe76 into hashicorp:master Jul 13, 2016
@aybabtme aybabtme deleted the terraform-volume-resource branch July 13, 2016 14:37
iceycake pushed a commit to ticketmaster/terraform that referenced this pull request Jul 22, 2016
* provider/digitalocean: add support for volumes

* provider/digitalocean: add documentation for volume resource
@ghost
Copy link

ghost commented Apr 24, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants