SecretManagerSecret


Property Value
Google Cloud Service Name Secret Manager
Google Cloud Service Documentation /secret-manager/docs/
Google Cloud REST Resource Name v1.projects.secrets
Google Cloud REST Resource Documentation /secret-manager/docs/reference/rest/v1/projects.secrets
Config Connector Resource Short Names gcpsecretmanagersecret
gcpsecretmanagersecrets
secretmanagersecret
Config Connector Service Name secretmanager.googleapis.com
Config Connector Resource Fully Qualified Name secretmanagersecrets.secretmanager.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember Yes
Supports IAM Conditions No
Supports IAM Audit Configs No
IAM External Reference Format

projects/{{project}}/secrets/{{secret_id}}

Config Connector Default Average Reconcile Interval In Seconds 600

Prerequisites

Before you can use this resource, assign the Secret Manager Admin role (roles/secretmanager.admin) on the project, folder, or organization. The required permission ‘secretmanager.versions.access’ is included in this role.

Custom Resource Definition Properties

Annotations

Fields
cnrm.cloud.google.com/project-id

Spec

Schema

annotations:
  string: string
expireTime: string
replication:
  auto:
    customerManagedEncryption:
      kmsKeyRef:
        external: string
        name: string
        namespace: string
  automatic: boolean
  userManaged:
    replicas:
    - customerManagedEncryption:
        kmsKeyRef:
          external: string
          name: string
          namespace: string
      location: string
resourceID: string
rotation:
  nextRotationTime: string
  rotationPeriod: string
topics:
- topicRef:
    external: string
    name: string
    namespace: string
ttl: string
versionAliases:
  string: string
Fields

annotations

Optional

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.

expireTime

Optional

string

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

replication

Optional

object

Optional. Immutable. The replication policy of the secret data attached to the [Secret][google.cloud.secretmanager.v1.Secret]. The replication policy cannot be changed after the Secret has been created.

replication.auto

Optional

object

The [Secret][google.cloud.secretmanager.v1.Secret] will automatically be replicated without any restrictions.

replication.auto.customerManagedEncryption

Optional

object

Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no configuration is provided, Google-managed default encryption is used. Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

replication.auto.customerManagedEncryption.kmsKeyRef

Required*

object

Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads. For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication policy type, Cloud KMS CryptoKeys must reside in the same location as the [replica location][Secret.UserManaged.Replica.location]. For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy type, Cloud KMS CryptoKeys must reside in `global`. The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.

replication.auto.customerManagedEncryption.kmsKeyRef.external

Optional

string

A reference to an externally managed KMSCryptoKey. Should be in the format `projects/[kms_project_id]/locations/[region]/keyRings/[key_ring_id]/cryptoKeys/[key]`.

replication.auto.customerManagedEncryption.kmsKeyRef.name

Optional

string

The `name` of a `KMSCryptoKey` resource.

replication.auto.customerManagedEncryption.kmsKeyRef.namespace

Optional

string

The `namespace` of a `KMSCryptoKey` resource.

replication.automatic

Optional

boolean

The Secret will automatically be replicated without any restrictions.

replication.userManaged

Optional

object

The [Secret][google.cloud.secretmanager.v1.Secret] will only be replicated into the locations specified.

replication.userManaged.replicas

Required*

list (object)

Required. The list of Replicas for this [Secret][google.cloud.secretmanager.v1.Secret]. Cannot be empty.

replication.userManaged.replicas[]

Required*

object

replication.userManaged.replicas[].customerManagedEncryption

Optional

object

Optional. The customer-managed encryption configuration of the [User-Managed Replica][Replication.UserManaged.Replica]. If no configuration is provided, Google-managed default encryption is used. Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

replication.userManaged.replicas[].customerManagedEncryption.kmsKeyRef

Required*

object

Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads. For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication policy type, Cloud KMS CryptoKeys must reside in the same location as the [replica location][Secret.UserManaged.Replica.location]. For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy type, Cloud KMS CryptoKeys must reside in `global`. The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.

replication.userManaged.replicas[].customerManagedEncryption.kmsKeyRef.external

Optional

string

A reference to an externally managed KMSCryptoKey. Should be in the format `projects/[kms_project_id]/locations/[region]/keyRings/[key_ring_id]/cryptoKeys/[key]`.

replication.userManaged.replicas[].customerManagedEncryption.kmsKeyRef.name

Optional

string

The `name` of a `KMSCryptoKey` resource.

replication.userManaged.replicas[].customerManagedEncryption.kmsKeyRef.namespace

Optional

string

The `namespace` of a `KMSCryptoKey` resource.

replication.userManaged.replicas[].location

Required*

string

The canonical IDs of the location to replicate data. For example: `"us-east1"`.

resourceID

Optional

string

Immutable. The SecretManagerSecret name. If not given, the metadata.name will be used.

rotation

Optional

object

Optional. Rotation policy attached to the [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is no rotation policy.

rotation.nextRotationTime

Optional

string

Optional. Timestamp in UTC at which the [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to rotate. Cannot be set to less than 300s (5 min) in the future and at most 3153600000s (100 years). [next_rotation_time][google.cloud.secretmanager.v1.Rotation.next_rotation_time] MUST be set if [rotation_period][google.cloud.secretmanager.v1.Rotation.rotation_period] is set.

rotation.rotationPeriod

Optional

string

Input only. The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If [rotation_period][google.cloud.secretmanager.v1.Rotation.rotation_period] is set, [next_rotation_time][google.cloud.secretmanager.v1.Rotation.next_rotation_time] must be set. [next_rotation_time][google.cloud.secretmanager.v1.Rotation.next_rotation_time] will be advanced by this period when the service automatically sends rotation notifications.

topics

Optional

list (object)

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.

topics[]

Optional

object

topics[].topicRef

Required*

object

topics[].topicRef.external

Optional

string

If provided must be in the format `projects/[project_id]/topics/[topic_id]`.

topics[].topicRef.name

Optional

string

The `metadata.name` field of a `PubSubTopic` resource.

topics[].topicRef.namespace

Optional

string

The `metadata.namespace` field of a `PubSubTopic` resource.

ttl

Optional

string

Input only. The TTL for the [Secret][google.cloud.secretmanager.v1.Secret].

versionAliases

Optional

map (key: string, value: string)

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 GetSecret and modifiable via UpdateSecret. Access by alias is only be supported on GetSecretVersion and AccessSecretVersion.

* Field is required when parent field is specified

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
externalRef: string
name: string
observedGeneration: integer
observedState: {}
Fields
conditions

list (object)

Conditions represent the latest available observations of the object's current state.

conditions[]

object

conditions[].lastTransitionTime

string

Last time the condition transitioned from one status to another.

conditions[].message

string

Human-readable message indicating details about last transition.

conditions[].reason

string

Unique, one-word, CamelCase reason for the condition's last transition.

conditions[].status

string

Status is the status of the condition. Can be True, False, Unknown.

conditions[].type

string

Type is the type of the condition.

externalRef

string

A unique specifier for the SecretManagerSecret resource in GCP.

name

string

[DEPRECATED] Please read from `.status.externalRef` instead. Config Connector will remove the `.status.name` in v1 Version.

observedGeneration

integer

ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.

observedState

object

ObservedState is the state of the resource as most recently observed in GCP.

Sample YAML(s)

Automatic Secret Replication

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1
kind: SecretManagerSecret
metadata:
  name: secretmanagersecret-sample-automatic
  labels:
    replication-type: automatic
spec:
  replication:
    automatic: true

User Managed Secret Replication

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1
kind: SecretManagerSecret
metadata:
  name: secretmanagersecret-sample-usermanaged
  labels:
    replication-type: user-managed
spec:
  replication:
    userManaged:
      replicas:
      - location: us-central1
      - location: us-east1