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
encryptionConfig
Optional
object
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.
encryptionConfig.encryptionType
Optional
string
Required. The encryption type of the backup.
encryptionConfig.kmsKeyRef
Optional
object
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/
encryptionConfig.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]`.
encryptionConfig.kmsKeyRef.name
Optional
string
The `name` of a `KMSCryptoKey` resource.
encryptionConfig.kmsKeyRef.namespace
Optional
string
The `namespace` of a `KMSCryptoKey` resource.
encryptionConfig.kmsKeyRefs
Optional
list (object)
Optional. Specifies the KMS configuration for the one or more keys used to
protect the backup. Values are of the form
`projects/
encryptionConfig.kmsKeyRefs[]
Optional
object
encryptionConfig.kmsKeyRefs[].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]`.
encryptionConfig.kmsKeyRefs[].name
Optional
string
The `name` of a `KMSCryptoKey` resource.
encryptionConfig.kmsKeyRefs[].namespace
Optional
string
The `namespace` of a `KMSCryptoKey` resource.
fullBackupSpec
Optional
object
The schedule creates only full backups.
incrementalBackupSpec
Optional
object
The schedule creates incremental backup chains.
resourceID
Optional
string
The SpannerBackupSchedule name. If not given, the metadata.name will be used.
retentionDuration
Optional
string
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.
spannerDatabaseRef
Optional
object
Required. The Spanner database that this backup applies to.
spannerDatabaseRef.external
Optional
string
A reference to an externally managed SpannerDatabase resource. Should be in the format "projects/{{projectID}}/instances/{{instanceID}}/databases/{{databaseID}}".
spannerDatabaseRef.name
Optional
string
The name of a SpannerDatabase resource.
spannerDatabaseRef.namespace
Optional
string
The namespace of a SpannerDatabase resource.
spec
Optional
object
Optional. The schedule specification based on which the backup creations are triggered.
spec.cronSpec
Optional
object
Cron style schedule specification.
spec.cronSpec.text
Optional
string
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:
-
0 2/12 * * *
: every 12 hours at (2, 14) hours past midnight in UTC. -
0 2,14 * * *
: every 12 hours at (2,14) hours past midnight in UTC. -
0 2 * * *
: once a day at 2 past midnight in UTC. -
0 2 * * 0
: once a week every Sunday at 2 past midnight in UTC. -
0 2 8 * *
: once a month on 8th day at 2 past midnight in UTC.
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