Skip to content

Commit 2763160

Browse files
committed
chore(jobs): update documentation with secret_reference
1 parent 776dab9 commit 2763160

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

docs/resources/job_definition.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,36 @@ 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+
secret_version = "1"
53+
file = "/home/dev/secret_file"
54+
}
55+
56+
secret_reference {
57+
secret_id = scaleway_secret.job_secret.id
58+
secret_version = "1"
59+
environment = "FOO"
60+
}
61+
}
62+
```
63+
3464
## Argument Reference
3565

3666
The following arguments are supported:
@@ -48,6 +78,13 @@ The following arguments are supported:
4878
- `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).
4979
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) of the Job.
5080
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the Job is associated with.
81+
- `secret_reference` - A reference to a secret stored in [Secret Manager](../resources/secret.md).
82+
- `secret_id` - 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.
83+
- `secret_version` - The secret version.
84+
- `file` - The absolute file path where the secret will be mounted. Must be specified if `environment` is not specified.
85+
- `environment` - An environment variable containing the secret value. Must be specified if `file` is not specified.
86+
- `secret_reference_id` - The secret reference UUID that is automatically generated by the provider.
87+
5188

5289
## Attributes Reference
5390

internal/services/jobs/jobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func ResourceDefinition() *schema.Resource {
122122
},
123123
"secret_version": {
124124
Type: schema.TypeString,
125-
Description: "The secret version, default to Latest.",
125+
Description: "The secret version.",
126126
Required: true,
127127
},
128128
"file": {

0 commit comments

Comments
 (0)