SpannerBackupSchedule
Property | Value |
---|---|
Google Cloud Service Name | Cloud Spanner |
Google Cloud Service Documentation | /spanner/docs/ |
Google Cloud REST Resource Name | projects.instances.backups |
Google Cloud REST Resource Documentation | /spanner/docs/reference/rest/v1/projects.instances.backup |
Config Connector Resource Short Names | gcpspannerbackupschedule gcpspannerbackupschedules spannerbackupschedule |
Config Connector Service Name | spanner.googleapis.com |
Config Connector Resource Fully Qualified Name | spannerbackupschedules.spanner.cnrm.cloud.google.com |
Can Be Referenced by IAMPolicy/IAMPolicyMember | No |
Config Connector Default Average Reconcile Interval In Seconds | 600 |
Custom Resource Definition Properties
Spec
Schema
encryptionConfig:
encryptionType: string
kmsKeyRef:
external: string
name: string
namespace: string
kmsKeyRefs:
- external: string
name: string
namespace: string
fullBackupSpec: {}
incrementalBackupSpec: {}
resourceID: string
retentionDuration: string
spannerDatabaseRef:
external: string
name: string
namespace: string
spec:
cronSpec:
text: string
Fields | |
---|---|
Optional |
Optional. The encryption configuration that will be used to encrypt the backup. If this field is not specified, the backup will use the same encryption configuration as the database. |
Optional |
Required. The encryption type of the backup. |
Optional |
Optional. The Cloud KMS key that will be used to protect the backup. This field should be set only when [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form `projects/ |
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 |
Optional. Specifies the KMS configuration for the one or more keys used to
protect the backup. Values are of the form
`projects/ |
Optional |
|
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 schedule creates only full backups. |
Optional |
The schedule creates incremental backup chains. |
Optional |
The SpannerBackupSchedule name. If not given, the metadata.name will be used. |
Optional |
Optional. The retention duration of a backup that must be at least 6 hours and at most 366 days. The backup is eligible to be automatically deleted once the retention period has elapsed. |
Optional |
Required. The Spanner database that this backup applies to. |
Optional |
A reference to an externally managed SpannerDatabase resource. Should be in the format "projects/{{projectID}}/instances/{{instanceID}}/databases/{{databaseID}}". |
Optional |
The name of a SpannerDatabase resource. |
Optional |
The namespace of a SpannerDatabase resource. |
Optional |
Optional. The schedule specification based on which the backup creations are triggered. |
Optional |
Cron style schedule specification. |
Optional |
Required. Textual representation of the crontab. User can customize the backup frequency and the backup version time using the cron expression. The version time must be in UTC timezone. The backup will contain an externally consistent copy of the database at the version time. Allowed frequencies are 12 hour, 1 day, 1 week and 1 month. Examples of valid cron specifications:
|
Status
Schema
conditions:
- lastTransitionTime: string
message: string
reason: string
status: string
type: string
externalRef: string
observedGeneration: integer
observedState:
cronSpec:
creationWindow: string
timeZone: string
updateTime: string
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 SpannerBackupSchedule resource in GCP. |
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. |
observedState.cronSpec |
Cron style schedule specification. |
observedState.cronSpec.creationWindow |
Output only. Schedule backups will contain an externally consistent copy of the database at the version time specified in `schedule_spec.cron_spec`. However, Spanner may not initiate the creation of the scheduled backups at that version time. Spanner will initiate the creation of scheduled backups within the time window bounded by the version_time specified in `schedule_spec.cron_spec` and version_time + `creation_window`. |
observedState.cronSpec.timeZone |
Output only. The time zone of the times in `CrontabSpec.text`. Currently only UTC is supported. |
observedState.updateTime |
Output only. The timestamp at which the schedule was last updated. If the schedule has never been updated, this field contains the timestamp when the schedule was first created. |
Sample YAML(s)
Typical Use Case
# Copyright 2025 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: spanner.cnrm.cloud.google.com/v1beta1
kind: SpannerBackupSchedule
metadata:
name: spannerbackupschedule-sample
spec:
spannerDatabaseRef:
name: spannerbackupschedule-dep
fullBackupSpec: {}
spec:
cronSpec:
text: 0 2 * * *
retentionDuration: "1209600s"
encryptionConfig:
encryptionType: "GOOGLE_DEFAULT_ENCRYPTION"
kmsKeyRef:
name: spannerbackupschedule-dep
---
apiVersion: kms.cnrm.cloud.google.com/v1beta1
kind: KMSCryptoKey
metadata:
name: spannerbackupschedule-dep
spec:
keyRingRef:
name: spannerbackupschedule-dep
purpose: ENCRYPT_DECRYPT
---
apiVersion: kms.cnrm.cloud.google.com/v1beta1
kind: KMSKeyRing
metadata:
name: spannerbackupschedule-dep
spec:
location: us-central1
---
apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: ServiceIdentity
metadata:
name: spannerbackupschedule-dep
annotations:
cnrm.cloud.google.com/deletion-policy: "abandon"
spec:
projectRef:
# Replace ${PROJECT_ID?} with your project ID.
external: ${PROJECT_ID?}
resourceID: aiplatform.googleapis.com
---
apiVersion: spanner.cnrm.cloud.google.com/v1beta1
kind: SpannerDatabase
metadata:
name: spannerbackupschedule-dep
spec:
instanceRef:
name: spannerbackupschedule-dep
ddl:
- "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)"
---
apiVersion: spanner.cnrm.cloud.google.com/v1beta1
kind: SpannerInstance
metadata:
name: spannerbackupschedule-dep
annotations:
alpha.cnrm.cloud.google.com/reconciler: "direct"
spec:
config: regional-us-west1
displayName: Spanner Database Dependency