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

add scaleway_user_data resource #57

Merged
merged 1 commit into from
Apr 10, 2018
Merged

add scaleway_user_data resource #57

merged 1 commit into from
Apr 10, 2018

Conversation

nicolai86
Copy link
Contributor

@nicolai86 nicolai86 commented Apr 1, 2018

this PR adds a scaleway_user_data resource to manage server specific user data.

Example usage:

resource "scaleway_server" "base" {
  name = "test"
  # ubuntu 14.04
  image = "5faef9cd-ea9b-4a63-9171-9e26bec03dbc"
  type = "C1"
  state = "stopped"

  user_data {
   key = "gcp_password"
   value = "supersupersecret"
  }
}

resource "scaleway_user_data" "gcp" {
  server = "${scaleway_server.base.id}"
  key = "gcp_username"
  value = "supersecret"
}

In this example two user data objects are being created: one, inline in the scaleway_server resource, and one as a separate resource.
Both user data objects can be accessed from the server. For more details see the user data documentation from scaleway.

test are green:

# make testacc TESTARGS="-ru
n='TestAccScalewayUserData_Basic'"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run='TestAccScalewayUserData_Basic' -timeout 120m
?   	github.com/terraform-providers/terraform-provider-scaleway	[no test files]
=== RUN   TestAccScalewayUserData_Basic
--- PASS: TestAccScalewayUserData_Basic (19.01s)
PASS
ok  	github.com/terraform-providers/terraform-provider-scaleway/scaleway	19.039s

@@ -0,0 +1,46 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add this to the sidebar? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for pointing out the sidebar! I've updated the PR!

@nicolai86 nicolai86 force-pushed the scaleway-user-data branch 5 times, most recently from 516ef54 to d7fe175 Compare April 7, 2018 18:19
@nicolai86 nicolai86 force-pushed the scaleway-user-data branch from d7fe175 to 695ee42 Compare April 7, 2018 18:59
@nicolai86
Copy link
Contributor Author

server tests are green with this change:

$ make testacc TESTARGS="-run='TestAccScalewayServer_'"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run='TestAccScalewayServer_' -timeout 120m
?   	github.com/terraform-providers/terraform-provider-scaleway	[no test files]
=== RUN   TestAccScalewayServer_importBasic
--- PASS: TestAccScalewayServer_importBasic (133.71s)
=== RUN   TestAccScalewayServer_Basic
--- PASS: TestAccScalewayServer_Basic (177.47s)
=== RUN   TestAccScalewayServer_ExistingIP
--- PASS: TestAccScalewayServer_ExistingIP (145.56s)
=== RUN   TestAccScalewayServer_Volumes
--- PASS: TestAccScalewayServer_Volumes (147.84s)
=== RUN   TestAccScalewayServer_SecurityGroup
--- PASS: TestAccScalewayServer_SecurityGroup (161.49s)
=== RUN   TestAccScalewayServer_UserData
--- PASS: TestAccScalewayServer_UserData (69.29s)
PASS
ok  	github.com/terraform-providers/terraform-provider-scaleway/scaleway	835.399s

@nicolai86
Copy link
Contributor Author

@tombuildsstuff I've updated the PR slightly to also include inline user_data attributes as part of the scaleway_server resource. Let me know what you think.

@nicolai86
Copy link
Contributor Author

Pulling this in optimistically - if additional adjustments are needed I’ll CR them separatly

@nicolai86 nicolai86 merged commit 0f59edf into master Apr 10, 2018
@nicolai86 nicolai86 deleted the scaleway-user-data branch July 12, 2018 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants