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
cnrm.cloud.google.com/state-into-spec

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)

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" }.

expireTime

Optional

string

Timestamp in UTC when the Secret is scheduled to expire. This is always provided on output, regardless of what was sent on input. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

replication

Required

object

Immutable. The replication policy of the secret data attached to the Secret. It cannot be changed after the Secret has been created.

replication.auto

Optional

object

The Secret will automatically be replicated without any restrictions.

replication.auto.customerManagedEncryption

Optional

object

The customer-managed encryption configuration of the Secret. If no configuration is provided, Google-managed default encryption is used.

replication.auto.customerManagedEncryption.kmsKeyRef

Required*

object

The customer-managed encryption configuration of the Secret. If no configuration is provided, Google-managed default encryption is used.

replication.auto.customerManagedEncryption.kmsKeyRef.external

Optional

string

Allowed value: The `selfLink` field of a `KMSCryptoKey` resource.

replication.auto.customerManagedEncryption.kmsKeyRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

replication.auto.customerManagedEncryption.kmsKeyRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

replication.automatic

Optional

boolean

DEPRECATED. `automatic` is deprecated. Use `auto` instead. The Secret will automatically be replicated without any restrictions.

replication.userManaged

Optional

object

Immutable. The Secret will be replicated to the regions specified by the user.

replication.userManaged.replicas

Required*

list (object)

Immutable. The list of Replicas for this Secret. Cannot be empty.

replication.userManaged.replicas[]

Required*

object

replication.userManaged.replicas[].customerManagedEncryption

Optional

object

Customer Managed Encryption for the secret.

replication.userManaged.replicas[].customerManagedEncryption.kmsKeyRef

Required*

object

Customer Managed Encryption for the secret.

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

Optional

string

Allowed value: The `selfLink` field of a `KMSCryptoKey` resource.

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

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

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

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

replication.userManaged.replicas[].location

Required*

string

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

resourceID

Optional

string

Immutable. Optional. The secretId of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.

rotation

Optional

object

The rotation time and period for a Secret. At 'next_rotation_time', Secret Manager will send a Pub/Sub notification to the topics configured on the Secret. 'topics' must be set to configure rotation.

rotation.nextRotationTime

Optional

string

Timestamp in UTC at which the Secret is scheduled to rotate. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

rotation.rotationPeriod

Optional

string

Immutable. The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If rotationPeriod is set, 'next_rotation_time' must be set. 'next_rotation_time' will be advanced by this period when the service automatically sends rotation notifications.

topics

Optional

list (object)

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

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[].topicRef.external

Optional

string

Allowed value: string of the format `projects/{{project}}/topics/{{value}}`, where {{value}} is the `name` field of a `PubSubTopic` resource.

topics[].topicRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

topics[].topicRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

ttl

Optional

string

Immutable. The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

versionAliases

Optional

map (key: string, value: string)

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. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

* Field is required when parent field is specified

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
createTime: string
name: string
observedGeneration: integer
Fields
conditions

list (object)

Conditions represent the latest available observation of the resource'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.

createTime

string

The time at which the Secret was created.

name

string

The resource name of the Secret. Format: 'projects/{{project}}/secrets/{{secret_id}}'.

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.

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