Read the module documentation for further explanation.
- Terraform 1.0+
- A Scaleway project (default project is fine but creating a new one is encouraged)
- curl, OpenSSH
- jq (only for magic commands)
- Create your SSH key pair and add the public key in authorized keys of your Scleway project in the Scaleway console
ssh-keygen -t rsa -b 4096 -q -C 'scaleway' -N '' -f ~/.ssh/scaleway
if using an existing SSH key, it is assumed its name is ~/.ssh/scaleway
- Retrieve your project credentials and export them:
export SCW_DEFAULT_PROJECT_ID=<REDACTED>
export SCW_ACCESS_KEY=<REDACTED>
export SCW_SECRET_KEY=<REDACTED>
export SCW_DEFAULT_REGION=fr-par
export SCW_DEFAULT_ZONE=fr-par-1
- Retrieve the (root) Terraform module of this example
mkdir ubuntu_dev1-s_full
cd ubuntu_dev1-s_full
curl -fsSL -O https://raw.githubusercontent.com/debovema/terraform-scaleway-dev-instance/main/examples/ubuntu_dev1-s_full/main.tf
- Initialize Terraform
terraform init
- Apply default plan
terraform apply
- SSH to the (first) created host
eval `terraform output --json ssh_commands | jq -r ".[0]"`
To display the SSH command used to connect:
echo $(terraform output --json ssh_commands | jq -r ".[0]")