Commit Graph

8 Commits

Author SHA1 Message Date
Raphael Randschau 2c3d54b671 provider/scaleway: allow public_ip to be set (#14515)
this allows the IP <-> server relationship to be inverted as requested by #14175.
2017-05-16 11:59:39 +03:00
Raphael Randschau 41e14baa57 provider/scaleway: improve schema resources (#13522)
improve readability by removing unecessary schema type declarations

this changeset does not include any semantic changes
2017-04-11 11:10:45 +03:00
Raphael Randschau 403ea9f6d7 provider/scaleway: work around parallel request limitation (#13045)
according to the official scaleway support, requests within the same session can
not be parallelized.

While I do not know for sure that this is a write-only limitation, I've
implemented it as a write-only limitation for now.

Previously requests like this would produce a 500 internal server error:

```
resource "scaleway_ip" "test_ip" {
  count = 2
}
```

now this limitation should be lifted, for all scaleway resources
2017-03-27 13:00:11 +03:00
Raphael Randschau fcaafee06b provider/scaleway: work around API concurrency issue (#12707)
when creating IPs concurrently the Scaleway API starts to return 500 internal
server errors.

since the error goes away when limiting concurrent requests, as well as the fact that the golang net/http client is safe for concurrent use,
I'm assuming this is an API error on Scaleways side.

this CS introduces a workaround so terraform does not crash for now.
the work around needs to be removed once Scaleway fixes their API
2017-03-15 16:23:18 +02:00
Raphael Randschau fc4c848778
provider/scaleway: add importer support 2016-10-15 23:49:14 +02:00
Raphael Randschau a5d105da36
provider/scaleway: use building DetachIP func 2016-10-10 20:02:10 +02:00
Raphael Randschau 9f314a3c29 provider/scaleway: Expose IPv6 support, improve documentation (#7784)
* provider/scaleway: update api version

* provider/scaleway: expose ipv6 support, rename ip attributes

since it can be both ipv4 and ipv6, choose a more generic name.

* provider/scaleway: allow servers in different SGs

* provider/scaleway: update documentation

* provider/scaleway: Update docs with security group

* provider/scaleway: add testcase for server security groups

* provider/scaleway: make deleting of security rules more resilient

* provider/scaleway: make deletion of security group more resilient

* provider/scaleway: guard against missing server
2016-07-25 12:49:09 +01:00
Raphael Randschau 9081cabd6e Add scaleway provider (#7331)
* Add scaleway provider

this PR allows the entire scaleway stack to be managed with terraform

example usage looks like this:

```
provider "scaleway" {
  api_key = "snap"
  organization = "snip"
}

resource "scaleway_ip" "base" {
  server = "${scaleway_server.base.id}"
}

resource "scaleway_server" "base" {
  name = "test"
  # ubuntu 14.04
  image = "aecaed73-51a5-4439-a127-6d8229847145"
  type = "C2S"
}

resource "scaleway_volume" "test" {
  name = "test"
  size_in_gb = 20
  type = "l_ssd"
}

resource "scaleway_volume_attachment" "test" {
  server = "${scaleway_server.base.id}"
  volume = "${scaleway_volume.test.id}"
}

resource "scaleway_security_group" "base" {
  name = "public"
  description = "public gateway"
}

resource "scaleway_security_group_rule" "http-ingress" {
  security_group = "${scaleway_security_group.base.id}"

  action = "accept"
  direction = "inbound"
  ip_range = "0.0.0.0/0"
  protocol = "TCP"
  port = 80
}

resource "scaleway_security_group_rule" "http-egress" {
  security_group = "${scaleway_security_group.base.id}"

  action = "accept"
  direction = "outbound"
  ip_range = "0.0.0.0/0"
  protocol = "TCP"
  port = 80
}
```

Note that volume attachments require the server to be stopped, which can lead to
downtimes of you attach new volumes to already used servers

* Update IP read to handle 404 gracefully

* Read back resource on update

* Ensure IP detachment works as expected

Sadly this is not part of the official scaleway api just yet

* Adjust detachIP helper

based on feedback from @QuentinPerez in
https://github.com/scaleway/scaleway-cli/pull/378

* Cleanup documentation

* Rename api_key to access_key

following @stack72 suggestion and rename the provider api_key for more clarity

* Make tests less chatty by using custom logger
2016-07-13 21:03:41 +01:00