resource_secrets
Creates, updates, deletes, gets or lists a resource_secrets resource.
Overview​
| Name | resource_secrets |
| Type | Resource |
| Id | ovh.okms.resource_secrets |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
iam | object | IAM resource metadata |
metadata | object | Secret metadata |
path | string | Unique identifier of the secret |
version | object | Data of the secret version |
An OKMS secret
| Name | Datatype | Description |
|---|---|---|
iam | object | IAM resource metadata |
metadata | object | Secret metadata |
path | string | Unique identifier of the secret |
version | object | Data of the secret version |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | okms_id, path | include_data, version | Returns a secret's metadata. By default the latest version is selected. Pass version to target another one.<br /><br />Set includeData=true to also return that version's data (requires the matching IAM action). |
list | select | okms_id | x_pagination_cursor, x_pagination_size, iam_tags | Lists secret paths with metadata (versions, CAS settings). The content of secret versions is not accessible through this API. |
create | insert | okms_id, path, version | Creates a secret at the given path and stores the first version.<br />Path and engine defaults (CAS, max versions) apply from the service secret config unless overridden in the body. | |
update | update | okms_id, path | cas | Updates the secret: include version.data to add a new version, and/or metadata to change this secret's engine settings.<br />When cas is set, it must equal the current version for the write to succeed. |
delete | delete | okms_id, path | Deletes the secret and all its versions. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
okms_id | string (uuid) | Okms ID (wire: okmsId) |
path | string | Path |
cas | integer | Current secret version number. When the cas (Check and set) is specified, the current version of the secret is verified before updating it. In order for a write to be successful,cas must be set to the current version of the secret. |
iam_tags | object | Filter resources on IAM tags (wire: iamTags) |
include_data | boolean | Secret data (wire: includeData) |
version | integer | Secret version. When omitted, the latest version will be returned. |
x_pagination_cursor | string | Pagination cursor (wire: X-Pagination-Cursor) |
x_pagination_size | integer | Pagination size (wire: X-Pagination-Size) |
SELECT examples​
- get
- list
Returns a secret's metadata. By default the latest version is selected. Pass version to target another one.<br /><br />Set includeData=true to also return that version's data (requires the matching IAM action).
SELECT
iam,
metadata,
path,
version
FROM ovh.okms.resource_secrets
WHERE okms_id = '{{ okms_id }}' -- required
AND path = '{{ path }}' -- required
AND include_data = '{{ include_data }}'
AND version = '{{ version }}'
;
Lists secret paths with metadata (versions, CAS settings). The content of secret versions is not accessible through this API.
SELECT
iam,
metadata,
path,
version
FROM ovh.okms.resource_secrets
WHERE okms_id = '{{ okms_id }}' -- required
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
AND iam_tags = '{{ iam_tags }}'
;
INSERT examples​
- create
- Manifest
Creates a secret at the given path and stores the first version.<br />Path and engine defaults (CAS, max versions) apply from the service secret config unless overridden in the body.
INSERT INTO ovh.okms.resource_secrets (
metadata,
path,
version,
okms_id
)
SELECT
'{{ metadata }}',
'{{ path }}' /* required */,
'{{ version }}' /* required */,
'{{ okms_id }}'
RETURNING
metadata,
path
;
# Description fields are for documentation purposes
- name: resource_secrets
props:
- name: okms_id
value: "{{ okms_id }}"
description: Required parameter for the resource_secrets resource.
- name: metadata
description: |
Secret metadata
value:
casRequired: {{ casRequired }}
customMetadata: "{{ customMetadata }}"
deactivateVersionAfter: "{{ deactivateVersionAfter }}"
maxVersions: {{ maxVersions }}
- name: path
value: "{{ path }}"
description: |
Secret path
- name: version
description: |
Data of the secret version
value:
data: "{{ data }}"
UPDATE examples​
- update
Updates the secret: include version.data to add a new version, and/or metadata to change this secret's engine settings.<br />When cas is set, it must equal the current version for the write to succeed.
UPDATE ovh.okms.resource_secrets
SET
metadata = '{{ metadata }}',
version = '{{ version }}'
WHERE
okms_id = '{{ okms_id }}' --required
AND path = '{{ path }}' --required
AND cas = '{{ cas}}'
RETURNING
metadata,
path;
DELETE examples​
- delete
Deletes the secret and all its versions.
DELETE FROM ovh.okms.resource_secrets
WHERE okms_id = '{{ okms_id }}' --required
AND path = '{{ path }}' --required
;