-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Add scaleway provider #7331
Add scaleway provider #7331
Conversation
Test output (cleaned up):
|
if server.State == targetState { | ||
break | ||
} | ||
time.Sleep(1 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any issue with 1 second refresh times? I.e. will we hit their API limit or anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I know there's no api limit. But maybe @moul can give some insight here.
Hi @nicolai86 I left a small comments - nothing major. If we can get them fixed up then that will be fantastic. I need to try and get in touch with Scaleway to see if we can get a testing account for terraform Paul |
Hey @stack72 thank you for your feedback. Will adjust this soonish. Best, |
@stack72 I think I adjusted everything based on your feedback. Ready for another review I'd say. |
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
Sadly this is not part of the official scaleway api just yet
Hi @nicolai86 This looks good to me now. I just need to get an account on scale way to test this out and we are GTG Paul |
based on feedback from @QuentinPerez in scaleway/scaleway-cli#378
page_title: "Provider: Scaleway" | ||
sidebar_current: "docs-scaleway-index" | ||
description: |- | ||
The Docker provider is used to interact with Docker containers and images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description should be for Scaleway :)
Hi @nicolai86 left 2 more small points on the docs side of things. Just managed to test this and the tests work as expected :) The tests are very chatty though:
Is there any way that this can be disabled? I.e can they be moved within our logging levels of INFO, DEBUG, TRACE and ERROR etc? P. |
following @stack72 suggestion and rename the provider api_key for more clarity
@stack72 I've updated the docs, renamed the |
Hi @nicolai86 This now looks great and the tests pass as expected. Thanks for making those logging changes! Paul |
Hey @stack72 thanks! If there are any bugs/ problems related to this feel free to pull me into the discussion. Raphael |
Will do! Thanks for all the help here :) |
* 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 scaleway/scaleway-cli#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
@nicolai86 For some reason remote-exec provisioner is not working with scaleway resouces. It's stuck in endless loop:
|
@sheerun I've got a more complex example of the scaleway provider up on github which works just fine with remote provisioner. Assuming you can SSH into your instance this should work just fine. Note that this implies either a) The above repo demos both. |
To summarize the use of option A
this works because setting option B
|
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. |
This PR adds a provider for the scaleway ARM cloud hosting provider.
One can manage the entire scaleway stack like this:
The PR includes tests & documentation.
Looking forward to your feedback!