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/scaleway add bootscript & image data_source #9386

Merged
merged 2 commits into from
Oct 18, 2016
Merged

provider/scaleway add bootscript & image data_source #9386

merged 2 commits into from
Oct 18, 2016

Conversation

nicolai86
Copy link
Contributor

@nicolai86 nicolai86 commented Oct 15, 2016

new data source scaleway_bootscript

Scaleway provides a number of bootscripts out of the box, detailing what kernel is being used when you use a scaleway_server resource. See the official docs

To ease the lookup of available bootscripts one can now use the scaleway_bootscript datasource like this:

data "scaleway_bootscript" "debug" {
  name = "x86_64 4.5.7 debug #3"
}

resource "scaleway_server" "test" {
  name = "test"
  bootscript = "${data.scaleway_bootscript.debug.id}`
  image = "5faef9cd-ea9b-4a63-9171-9e26bec03dbc"
  type = "C1"
}

The added test cases are passing:

make testacc TEST=./builtin/providers/scaleway TESTARGS='-run=TestAccScalewayDataSourceBootscript'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/15 14:26:48 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/scaleway -v -run=TestAccScalewayDataSourceBootscript -timeout 120m
=== RUN   TestAccScalewayDataSourceBootscript_Basic
--- PASS: TestAccScalewayDataSourceBootscript_Basic (1.76s)
=== RUN   TestAccScalewayDataSourceBootscript_Filtered
--- PASS: TestAccScalewayDataSourceBootscript_Filtered (1.86s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/scaleway   3.638s

Also related to #8678

new data source scaleway_image

looking up image ids has been manual & painful up until now. The scaleway_image resource aims at solving this:

data "scaleway_image" "ubuntu" {
  architecture = "arm"
  name = "Ubuntu Precise"
}

resource "scaleway_server" "base" {
  name = "test"
  image = "${data.scaleway_image.ubuntu.id}"
  type = "C1"
}

the tests for this are green as well:

TF_ACC=1 go test ./builtin/providers/scaleway -v -run=TestAccScalewayDataSourceImage -timeout 120m
=== RUN   TestAccScalewayDataSourceImage_Basic
--- PASS: TestAccScalewayDataSourceImage_Basic (10.40s)
=== RUN   TestAccScalewayDataSourceImage_Filtered
--- PASS: TestAccScalewayDataSourceImage_Filtered (8.97s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/scaleway   19.388s

@nicolai86 nicolai86 changed the title provider/scaleway add bootscript data_source provider/scaleway add bootscript & image data_source Oct 15, 2016
bootscripts allow you to start Scaleway servers with a specific kernel version.
The `scaleway_server`  has always had a bootscript parameter, and the
`scaleway_bootscript` datasource allows you to lookup bootscripts to be used in
conjunction with the `scaleway_server` resource.
@jen20
Copy link
Contributor

jen20 commented Oct 18, 2016

Thanks @nicolai86!

@jen20
Copy link
Contributor

jen20 commented Oct 18, 2016

One thing I notice is missing is a link to the new documentation pages in the side bar. I'll merge this locally and add that in.

@jen20 jen20 merged commit 903170d into hashicorp:master Oct 18, 2016
@ghost
Copy link

ghost commented Apr 21, 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 21, 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.

2 participants