REST Resource: projects.secrets

Resource: Secret

A Secret is a logical secret whose value and versions can be accessed.

A Secret is made up of zero or more SecretVersions that represent the secret data.

JSON representation
{
  "name": string,
  "replication": {
    object (Replication)
  },
  "createTime": string,
  "labels": {
    string: string,
    ...
  },
  "topics": [
    {
      object (Topic)
    }
  ],
  "etag": string,
  "rotation": {
    object (Rotation)
  },
  "versionAliases": {
    string: string,
    ...
  },
  "annotations": {
    string: string,
    ...
  },
  "versionDestroyTtl": string,
  "customerManagedEncryption": {
    object (CustomerManagedEncryption)
  },
  "tags": {
    string: string,
    ...
  },
  "secretType": enum (SecretType),
  "policyMember": {
    object (ResourcePolicyMember)
  },

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "expireTime": string,
  "ttl": string
  // End of mutually exclusive fields.
}
Fields
name

string

Output only. The resource name of the Secret in the format projects/*/secrets/*.

replication

object (Replication)

Optional. Immutable. The replication policy of the secret data attached to the Secret.

The replication policy cannot be changed after the Secret has been created.

createTime

string (Timestamp format)

Output only. The time at which the Secret was created.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

labels

map (key: string, value: string)

The labels assigned to this Secret.

Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}

Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}

No more than 64 labels can be assigned to a given resource.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

topics[]

object (Topic)

Optional. A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions.

etag

string

Optional. Etag of the currently stored Secret.

rotation

object (Rotation)

Optional. Rotation policy attached to the Secret. May be excluded if there is no rotation policy.

versionAliases

map (key: string, value: string (int64 format))

Optional. Mapping from version alias to version name.

A version alias is a string with a maximum length of 63 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore ('_') characters. An alias string must start with a letter and cannot be the string 'latest' or 'NEW'. No more than 50 aliases can be assigned to a given secret.

Version-Alias pairs will be viewable via secrets.get and modifiable via secrets.patch. Access by alias is only be supported on versions.get and versions.access.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

annotations

map (key: string, value: string)

Optional. Custom metadata about the secret.

Annotations are distinct from various forms of labels. Annotations exist to allow client tools to store their own state information without requiring a database.

Annotation keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, begin and end with an alphanumeric character ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and alphanumerics in between these symbols.

The total size of annotation keys and values must be less than 16KiB.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

versionDestroyTtl

string (Duration format)

Optional. Secret Version TTL after destruction request

This is a part of the Delayed secret version destroy feature. For secret with TTL>0, version destruction doesn't happen immediately on calling destroy instead the version goes to a disabled state and destruction happens after the TTL expires.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

customerManagedEncryption

object (CustomerManagedEncryption)

Optional. The customer-managed encryption configuration of the regionalized secrets. If no configuration is provided, Google Cloud-powered encryption key is used.

Updates to the Secret encryption configuration only apply to SecretVersions added afterwards. They do not apply retroactively to existing SecretVersions.

tags

map (key: string, value: string)

Optional. Input only. Immutable. Mapping of Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing"

Tags are used to organize and group resources.

Tags can be used to control policy evaluation for the resource.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

secretType

enum (SecretType)

Optional. Immutable. This defines the type of the secret. Enforces certain structural requirements on the SecretVersions. For secret of type UNSPECIFIED, the SecretVersions can be of any type.

policyMember

object (ResourcePolicyMember)

Output only. Defines the policy member for the secret. This will be used to check if the caller has the permission to perform certain operations on the typed secret.

Expiration policy attached to the Secret. If specified the Secret and all SecretVersions will be automatically deleted at expiration. Expired secrets are irreversibly deleted.

Expiration is not the recommended way to set time-based permissions. IAM Conditions is recommended for granting time-based permissions because the operation can be reversed. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:

expireTime

string (Timestamp format)

Optional. Timestamp in UTC when the Secret is scheduled to expire. This is always provided on output, regardless of what was sent on input.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

ttl

string (Duration format)

Input only. The TTL for the Secret.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

End of mutually exclusive fields.

Methods

addVersion

Creates a new SecretVersion containing secret data and attaches it to an existing Secret.

create

Creates a new Secret containing no SecretVersions.

delete

Deletes a Secret.

get

Gets metadata for a given Secret.

getIamPolicy

Gets the access control policy for a secret.

list

Lists Secrets.

patch

Updates metadata of an existing Secret.

setIamPolicy

Sets the access control policy on the specified secret.

testIamPermissions

Returns permissions that a caller has for the specified secret.

enableManagedRotation

The method google.cloud.secretmanager.v1.SecretManagerService.EnableManagedRotation is not available in Cloud de Confiance by S3NS.

rotateSecret

The method google.cloud.secretmanager.v1.SecretManagerService.RotateSecret is not available in Cloud de Confiance by S3NS.