-
Notifications
You must be signed in to change notification settings - Fork 260
docs(srv): add SEM x Jobs documentation MTA-5199 #3898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8d3b145
docs(srv): add SEM x Jobs documentation MTA-5199
SamyOubouaziz 9d6750f
Update serverless/jobs/quickstart.mdx
SamyOubouaziz 107d058
Update faq/serverless-jobs.mdx
SamyOubouaziz e7f7893
Update serverless/jobs/how-to/reference-secret-in-job.mdx
SamyOubouaziz e58e824
Update serverless/jobs/how-to/reference-secret-in-job.mdx
SamyOubouaziz 277a8bf
Update serverless/jobs/how-to/reference-secret-in-job.mdx
SamyOubouaziz 9a0a861
Update serverless/jobs/how-to/reference-secret-in-job.mdx
SamyOubouaziz 4c120be
Update serverless/jobs/how-to/reference-secret-in-job.mdx
SamyOubouaziz c03f581
Update serverless/jobs/how-to/reference-secret-in-job.mdx
SamyOubouaziz 20934eb
Update serverless/jobs/quickstart.mdx
SamyOubouaziz d49219c
docs(srv): upadate
SamyOubouaziz d3efc2d
Update serverless/jobs/how-to/reference-secret-in-job.mdx
SamyOubouaziz 34f14e9
Update serverless/jobs/how-to/create-job-from-external-registry.mdx
SamyOubouaziz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| --- | ||
| meta: | ||
| title: How to reference secrets in Serverless Jobs | ||
| description: Steps to reference secrets from Secret Manager in your Serverless Jobs. | ||
| content: | ||
| h1: How to reference secrets in Serverless Jobs | ||
| paragraph: Steps to reference secrets from Secret Manager in your Serverless Jobs. | ||
| tags: serverless jobs secrets secret-manager environment-variable | ||
| dates: | ||
| validation: 2024-10-27 | ||
| posted: 2024-10-27 | ||
| categories: | ||
| - serverless | ||
| - jobs | ||
| --- | ||
|
|
||
| Serverless Jobs seamlessly integrates with [Secret Manager](/identity-and-access-management/secret-manager/), which allows you to store, manage, and access sensitive information, such as credentials, SSH keys, SSL/TLS certificates, or any key/value pairs you need to secure. | ||
|
|
||
| You can reference any secret stored in Secret Manager in a job, without having to hardcode any sensitive data. | ||
|
|
||
| A [job run](/serverless/jobs/concepts/#job-run) accesses each secret at startup, and each access generates a call to the Secret Manager API, which is billed accordingly. Refer to the [Secret Manager pricing](/identity-and-access-management/secret-manager) for more information. | ||
|
|
||
| <Macro id="requirements" /> | ||
|
|
||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - [Created a Serverless Job](/serverless/jobs/how-to/create-job-from-scaleway-registry/) | ||
| - [Created a secret](/identity-and-access-management/secret-manager/how-to/create-secret/) | ||
|
|
||
| ## Reference a secret in a job | ||
|
|
||
| 1. Click **Jobs** in the **Serverless** section of the side menu. The jobs page displays. | ||
|
|
||
| 2. Click the name of the job to which you want to add a secret, then open the **Settings** tab. | ||
|
|
||
| 3. In the **Secrets references** section, click **+ Add secret reference**. A pop-up displays. | ||
|
|
||
| 4. Select the secret you want to reference, and the desired version, then click **Select reference method**. | ||
|
|
||
| 5. Select the desired reference method: | ||
|
|
||
| - **File**: copies the encrypted value of your secret to a file stored at the indicated location within your container. This method is recommended for large or complex data. For example, if your secret is a certificate, you can store it as a file in the `/my-certificates` folder in your container. | ||
|
|
||
| - **Environment variable**: passes the encrypted value of your secret to your job as a variable. This method is recommended for small pieces of information, such as passwords, or API secret keys. For example, if you name this variable `MY_SECRET`, calling `$MY_SECRET` in your container will return the value of the selected secret in a secure way. | ||
SamyOubouaziz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 6. Click **Add reference** to add the secret to your Serverless Job. Optionally, tick the **Add another reference** to add a new secret right away, then repeat steps 4 to 6. | ||
|
|
||
| The secret is now referenced in your Serverless Job, and can be used within the container. | ||
SamyOubouaziz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Update a secret reference from a job | ||
|
|
||
| 1. Click **Jobs** in the **Serverless** section of the side menu. The jobs page displays. | ||
|
|
||
| 2. Click the name of the job for which you want to update a secret, then open the **Settings** tab. | ||
|
|
||
| 3. In the **Secret references** section, click the <Icon name="edit" /> icon next to the secret reference you want to update. A pop-up displays. | ||
|
|
||
| 4. Update the secret version if needed, then click **Update** to save your changes, or click **Select reference method** to continue. | ||
|
|
||
| 5. Either update the location of the file, or the name of the environment variable, then click **Update reference** to confirm your changes. | ||
|
|
||
| <Message type="note"> | ||
| You cannot change the reference method of an existing secret. You have to delete the secret reference within the job first, then create it again with the desired reference method. | ||
SamyOubouaziz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </Message> | ||
|
|
||
| ## Delete a secret reference from a job | ||
|
|
||
| 1. Click **Jobs** in the **Serverless** section of the side menu. The jobs page displays. | ||
|
|
||
| 2. Click the name of the job for which you want to delete a secret, then open the **Settings** tab. | ||
|
|
||
| 3. In the **Secret references** section, click the <Icon name="delete" /> icon next to the secret reference you want to delete. A confirmation pop-up displays. | ||
|
|
||
| 4. Click **Delete reference** to confirm. | ||
|
|
||
| The secret is no longer referenced in your Serverless Job. | ||
|
|
||
| <Message type="note"> | ||
| Deleting a secret from the **Settings** tab of a job only deletes the secret reference, not the secret itself. To permanently delete a secret, follow [this procedure](/identity-and-access-management/secret-manager/how-to/delete-secret/). | ||
| </Message> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.