Skip to content

Commit 2c77309

Browse files
committed
chore(jobs): update documentation with secret_reference
1 parent 28f5b43 commit 2c77309

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/resources/job_definition.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,35 @@ resource scaleway_job_definition main {
3131
}
3232
```
3333

34+
### With Secret Reference
35+
36+
```terraform
37+
resource scaleway_job_definition main {
38+
name = "testjob"
39+
cpu_limit = 140
40+
memory_limit = 256
41+
image_uri = "docker.io/alpine:latest"
42+
command = "ls"
43+
timeout = "10m"
44+
45+
cron {
46+
schedule = "5 4 1 * *" # cron at 04:05 on day-of-month 1
47+
timezone = "Europe/Paris"
48+
}
49+
50+
secret_reference {
51+
secret_id = "11111111-1111-1111-1111-111111111111"
52+
file = "/home/dev/secret_file"
53+
}
54+
55+
secret_reference {
56+
secret_id = scaleway_secret.job_secret.id
57+
secret_version = "1"
58+
environment = "FOO"
59+
}
60+
}
61+
```
62+
3463
## Argument Reference
3564

3665
The following arguments are supported:
@@ -48,6 +77,13 @@ The following arguments are supported:
4877
- `timezone` - The timezone, must be a canonical TZ identifier as found in this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
4978
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) of the Job.
5079
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the Job is associated with.
80+
- `secret_reference` - (Optional) A reference to a secret stored in [Secret Manager](../resources/secret.md).
81+
- `secret_id` - (Required) The secret unique identifier, it could be formatted as region/UUID or UUID. In case the region is passed, it must be the same as the job definition. You could reference the same secret multiple times in the same job definition.
82+
- `secret_version` - (Default: `latest`) The secret version.
83+
- `file` - (Optional) The absolute file path where the secret will be mounted. Must be specified if `environment` is not specified.
84+
- `environment` - (Optional) An environment variable containing the secret value. Must be specified if `file` is not specified.
85+
- `secret_reference_id` - The secret reference UUID that is automatically generated by the provider.
86+
5187

5288
## Attributes Reference
5389

0 commit comments

Comments
 (0)