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 | |
---|---|
Optional |
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. |
Optional |
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. |
Optional |
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. |
Optional |
The [Secret][google.cloud.secretmanager.v1.Secret] will automatically be replicated without any restrictions. |
Optional |
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]. |
Required* |
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/*`. |
Optional |
A reference to an externally managed KMSCryptoKey. Should be in the format `projects/[kms_project_id]/locations/[region]/keyRings/[key_ring_id]/cryptoKeys/[key]`. |
Optional |
The `name` of a `KMSCryptoKey` resource. |
Optional |
The `namespace` of a `KMSCryptoKey` resource. |
Optional |
The Secret will automatically be replicated without any restrictions. |
Optional |
The [Secret][google.cloud.secretmanager.v1.Secret] will only be replicated into the locations specified. |
Required* |
Required. The list of Replicas for this [Secret][google.cloud.secretmanager.v1.Secret]. Cannot be empty. |
Required* |
|
Optional |
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]. |
Required* |
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/*`. |
Optional |
A reference to an externally managed KMSCryptoKey. Should be in the format `projects/[kms_project_id]/locations/[region]/keyRings/[key_ring_id]/cryptoKeys/[key]`. |
Optional |
The `name` of a `KMSCryptoKey` resource. |
Optional |
The `namespace` of a `KMSCryptoKey` resource. |
Required* |
The canonical IDs of the location to replicate data. For example: `"us-east1"`. |
Optional |
Immutable. The SecretManagerSecret name. If not given, the metadata.name will be used. |
Optional |
Optional. Rotation policy attached to the [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is no rotation policy. |
Optional |
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. |
Optional |
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. |
Optional |
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. |
Optional |
|
Required* |
|
Optional |
If provided must be in the format `projects/[project_id]/topics/[topic_id]`. |
Optional |
The `metadata.name` field of a `PubSubTopic` resource. |
Optional |
The `metadata.namespace` field of a `PubSubTopic` resource. |
Optional |
Input only. The TTL for the [Secret][google.cloud.secretmanager.v1.Secret]. |
Optional |
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 |
Conditions represent the latest available observations of the object's current state. |
conditions[] |
|
conditions[].lastTransitionTime |
Last time the condition transitioned from one status to another. |
conditions[].message |
Human-readable message indicating details about last transition. |
conditions[].reason |
Unique, one-word, CamelCase reason for the condition's last transition. |
conditions[].status |
Status is the status of the condition. Can be True, False, Unknown. |
conditions[].type |
Type is the type of the condition. |
externalRef |
A unique specifier for the SecretManagerSecret resource in GCP. |
name |
[DEPRECATED] Please read from `.status.externalRef` instead. Config Connector will remove the `.status.name` in v1 Version. |
observedGeneration |
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 |
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