Skip to content

Commit c40279c

Browse files
SIMVIA-lucas-sovrejcirinosclwynerda-codesbene2k1
authored
Apply suggestions from code review
Co-authored-by: Jessica <[email protected]> Co-authored-by: Néda <[email protected]> Co-authored-by: Benedikt Rollik <[email protected]>
1 parent fe9e1e3 commit c40279c

File tree

1 file changed

+15
-14
lines changed
  • tutorials/terraform-dynamic-gitlab-runner

1 file changed

+15
-14
lines changed

tutorials/terraform-dynamic-gitlab-runner/index.mdx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,24 @@ tags: automation terraform instances GitLab ci-cd
55
categories:
66
- instances
77
- devtools
8+
dates:
9+
validation: 2025-08-05
810
---
911

1012
import Requirements from '@macros/iam/requirements.mdx'
1113

12-
## Gitlab runner overview
1314

1415
GitLab runners are the components that execute the jobs defined in your GitLab CI/CD pipelines. They can be installed on various operating systems and can run jobs on different platforms. Runners can be configured to be specific to a project or shared across multiple projects.
15-
With terraform Scaleway provider and GitLab one, runners can be dynamically created and destroyed.
16+
With the Terraform Scaleway provider and GitLab one, runners can be dynamically created and destroyed.
1617

1718
<Requirements />
1819

1920
- A Scaleway account logged into the [console](https://console.scaleway.com)
2021
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
21-
- [Created IAM API key](/iam/how-to/create-api-keys/)
22+
- [Created an API key](/iam/how-to/create-api-keys/)
2223
- A GitLab account and project
2324

24-
## Provision a GitLab runner on a Scaleway instance with terraform.
25+
## Provision a GitLab runner on a Scaleway Instance with Terraform/OpenTofu.
2526

2627
### Gitlab setup
2728

@@ -31,13 +32,13 @@ The following GitLab CI/CD needs 3 secret variables:
3132
- SCW_ACCES_KEY
3233

3334
The `GITLAB_TOKEN` needs to be a GitLab personal access token with the **Owner** role, and `create_runner` scope.
34-
Create the environment variables in your [project cicd settings](https://docs.gitlab.com/ci/variables/)
35+
Create the environment variables in your [project CI/CD settings](https://docs.gitlab.com/ci/variables/)
3536

36-
### terraform setup
37+
### Terraform/OpenTofu setup
3738

38-
Start by providing a basic Terraform setup:
39+
Start by providing a basic Terraform/OpenTofu setup:
3940

40-
1. Create the `main.tf` file:
41+
1. Create a `main.tf` file and paste the following content into it:
4142
```hcl
4243
//providers
4344
terraform {
@@ -108,7 +109,7 @@ Start by providing a basic Terraform setup:
108109
value = gitlab_user_runner.project_runner.id
109110
}
110111
```
111-
2. Create the `var.tf` file:
112+
2. Create a `var.tf` file and paste the following content into it:
112113
```hcl
113114
variable "project_id" {
114115
type = string
@@ -117,7 +118,7 @@ Start by providing a basic Terraform setup:
117118

118119
variable "scw_org_id" {
119120
type = string
120-
description = "Your scaleway organisation ID"
121+
description = "Your Scaleway Organization ID"
121122
}
122123

123124
variable "secret_key" {
@@ -167,7 +168,7 @@ Start by providing a basic Terraform setup:
167168
description = "volume in Gb"
168169
}
169170
```
170-
3. Create the `cloud-init.yml` file:
171+
3. Create a `cloud-init.yml` file and paste the following content into it:
171172
```yml
172173
#cloud-config
173174
package_update: true
@@ -192,7 +193,7 @@ Start by providing a basic Terraform setup:
192193

193194
### Gitlab setup
194195

195-
1. Create the .gitlab-ci.yml :
196+
1. Create the `.gitlab-ci.yml` configuration file:
196197
```yml
197198
stages:
198199
- provision
@@ -203,7 +204,7 @@ Start by providing a basic Terraform setup:
203204
cat <<EOF > env.tfvars
204205
scw_org_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
205206
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
206-
access_key = "$SCW_ACCES_KEY"
207+
access_key = "$SCW_ACCESS_KEY"
207208
secret_key = "$SCW_SECRET_KEY"
208209
gitlab_token = "$GITLAB_TOKEN"
209210
gitlab_project_id = "$CI_PROJECT_ID"
@@ -299,7 +300,7 @@ Start by providing a basic Terraform setup:
299300
```
300301

301302
With this setup, GitLab-CI/CD creates an Instance and registers it as a GitLab runner, runs the workload on the Instance, then deletes the Instance and the runner.
302-
This setup allows you to dynamically provide high-computation runners in a cost-effective way. You can also customize the cloud init to fit your business needs, such as connecting to your company's VPN.
303+
This setup allows you to dynamically provide high-computation runners in a cost-effective way. You can also customize the cloud-init to fit your business needs, such as connecting to your company's VPN.
303304

304305
## Going further
305306

0 commit comments

Comments
 (0)