{"id":26709744,"url":"https://github.com/debovema/terraform-scaleway-dev-instance","last_synced_at":"2025-04-13T17:32:52.550Z","repository":{"id":47631933,"uuid":"168240804","full_name":"debovema/terraform-scaleway-dev-instance","owner":"debovema","description":"A Terraform module to create development instances on Scaleway servers initialized with cloud-init","archived":false,"fork":false,"pushed_at":"2022-06-02T15:06:50.000Z","size":31,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T08:18:46.510Z","etag":null,"topics":["cloud-init","remote","remote-dev-server","remote-development","scaleway","ssh","terraform","terraform-module","vscode"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/debovema.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-29T22:39:49.000Z","updated_at":"2023-08-21T13:24:56.000Z","dependencies_parsed_at":"2022-09-06T19:42:44.176Z","dependency_job_id":null,"html_url":"https://github.com/debovema/terraform-scaleway-dev-instance","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debovema%2Fterraform-scaleway-dev-instance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debovema%2Fterraform-scaleway-dev-instance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debovema%2Fterraform-scaleway-dev-instance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debovema%2Fterraform-scaleway-dev-instance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/debovema","download_url":"https://codeload.github.com/debovema/terraform-scaleway-dev-instance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248752418,"owners_count":21156086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-init","remote","remote-dev-server","remote-development","scaleway","ssh","terraform","terraform-module","vscode"],"created_at":"2025-03-27T08:18:49.598Z","updated_at":"2025-04-13T17:32:52.522Z","avatar_url":"https://github.com/debovema.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scaleway development instances using Terraform and cloud-init\n\n## Foreword\n\nThis Terraform module can be used to create cheap and disposable development machines with Scaleway cloud provider. For instance, these machines are well suited to be used with [Visual Studio Code SSH remote developement feature](https://code.visualstudio.com/docs/remote/ssh).\n\n## Examples\n\n* [Full-featured development instance on a Scaleway DEV1-S instance running Ubuntu 20.04](examples/ubuntu_dev1-s_full)\n\n## Prerequisites\n\n* Terraform 1.0+\n* A [Scaleway project](https://console.scaleway.com/project/) (default project is fine but [creating a new one](https://www.scaleway.com/en/docs/scaleway-project/) is encouraged)\n* Git, OpenSSH\n* [jq](https://stedolan.github.io/jq/) (only for magic commands)\n\n## Introduction\n\n1. Define shell helper function to set Terraform variables\n\n```\nset_tfvar() { ( [ $(grep \"$1\" terraform.tfvars 2\u003e/dev/null | wc -l) -gt 0 ] \u0026\u0026 sed -i -e \"/^$1 /s/=.*$/= $(echo $2 | sed 's|\\\"|\\\\\"|g' | sed 's|/|\\\\/|g')/\" terraform.tfvars ) || echo \"$1 = $2\" \u003e\u003e terraform.tfvars }\n```\n\n\u003e This shell function takes two arguments (the variable key and value) and put the *key = value* in the *terraform.tfvars* file regardless of the existence of the variable (create or replace behaviour)\n\n2. Create your SSH key pair and [add the public key in authorized keys of your Scleway project in the Scaleway console](https://console.scaleway.com/project/credentials)\n\n```\nssh-keygen -t ed25519 -q -C 'scaleway' -N '' -f ~/.ssh/scaleway\n```\n\n\u003e if using an existing SSH key, it is assumed its name is *~/.ssh/scaleway*\n\nAdd the SSH key file in Terraform variables\n```\nset_tfvar ssh_key_file '\"~/.ssh/scaleway\"'\n```\n\n3. [Retrieve your project credentials](https://console.scaleway.com/project/credentials) and export them:\n\n```\nexport SCW_DEFAULT_PROJECT_ID=\u003cREDACTED\u003e\nexport SCW_ACCESS_KEY=\u003cREDACTED\u003e\nexport SCW_SECRET_KEY=\u003cREDACTED\u003e\nexport SCW_DEFAULT_REGION=fr-par\nexport SCW_DEFAULT_ZONE=fr-par-1\n```\n\n## Usage\n\n1. Clone this repository\n\n```\ngit clone https://github.com/debovema/terraform-scaleway-dev-instance.git\ncd terraform-scaleway-dev-instance\n```\n\n2. Initialize Terraform\n\n```\nterraform init\n```\n\n3. Define username\n\n```\nset_tfvar username '\"developer\"'\n```\n\n\u003e Mind the double quotes\n\n4. Select optional features\n\n* [Oh My ZSH](https://ohmyz.sh/):\n```\nset_tfvar feature_omz true\n```\n\n* [Docker](https://www.docker.com/):\n```\nset_tfvar feature_docker true\n```\n\n* [nvm](https://github.com/nvm-sh/nvm) (for Node developments):\n```\nset_tfvar feature_nvm true\n```\n\n* [SDKMAN!](https://sdkman.io/) (for Java developments):\n```\nset_tfvar feature_sdkman true\n```\n\n5. Apply default plan\n```\nterraform apply\n```\n\n6. SSH to the (first) created host\n\n```\neval `terraform output --json ssh_commands | jq -r \".[0]\"`\n```\n\n\u003e To display the SSH command used to connect:\n\u003e ```\n\u003e echo $(terraform output --json ssh_commands | jq -r \".[0]\")\n\u003e ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebovema%2Fterraform-scaleway-dev-instance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebovema%2Fterraform-scaleway-dev-instance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebovema%2Fterraform-scaleway-dev-instance/lists"}