Resource
dcloud_secret_grant
Lets one consumer read a secret's value: CI runs (actions, optionally one repository), deployed apps (deploy), the CLI, Code or compute instances.
Example Usage
# Deployed apps may read the token; CI runs of one repository too, for 90 days.
resource "dcloud_secret_grant" "deploy" {
secret_id = dcloud_secret.api_token.id
consumer = "deploy"
}
resource "dcloud_secret_grant" "ci" {
secret_id = dcloud_secret.api_token.id
consumer = "actions"
repository_id = var.repository_id
ttl_days = 90
}
variable "repository_id" {
type = string
}Schema
Required
consumer(String) Which consumer may read the value, e.g. actions (CI runs), deploy (deployed apps) or registry (pull-through cache credentials) One of:actions,deploy,cli,code,compute,registry. Changing it replaces the resource.secret_id(String) The id of the parent resource ({id}in the path). Changing it replaces the resource.
Optional
repository_id(String) Limit an actions grant to one repository; omitted or null means every repository. A UUID. Changing it replaces the resource.ttl_days(Number) Days until the grant expires; leave out for no expiry. Seeexpires_at. Never returned by the API: not read back, and empty after an import. Changing it replaces the resource.
Read-Only
expires_at(String) When the grant expires; null for never.id(String) The resource's id.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# `ttl_days` is not read back (see `expires_at`).
terraform import dcloud_secret_grant.deploy <secret-id>/<grant-id>Generated from the provider's schema.
Related