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

Custom Resource Definition Properties

Annotations

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

Spec

Schema

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

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.automatic

Optional

boolean

Immutable. The Secret will automatically be replicated without any restrictions.

replication.userManaged

Optional

object

Immutable. The Secret will automatically be replicated without any restrictions.

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

Immutable. 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

The selfLink of a KMSCryptoKey.

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)

topics.[]

Optional

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

Optional

string

The name of a PubSubTopic.

topics.[].name

Optional

string

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

topics.[].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".

* 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