public sealed class CreateBackupEncryptionConfig : IMessage<CreateBackupEncryptionConfig>, IEquatable<CreateBackupEncryptionConfig>, IDeepCloneable<CreateBackupEncryptionConfig>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Spanner Database Administration v1 API class CreateBackupEncryptionConfig.
Encryption configuration for the backup to create.
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/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>.
Optional. Specifies the KMS configuration for the one or more keys used to
protect the backup. Values are of the form
projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>.
The keys referenced by kms_key_names must fully cover all
regions of the backup's instance configuration. Some examples:
For single region instance configs, specify a single regional
location KMS key.
For multi-regional instance configs of type GOOGLE_MANAGED,
either specify a multi-regional location KMS key or multiple regional
location KMS keys that cover all regions in the instance config.
For an instance config of type USER_MANAGED, please specify only
regional location KMS keys to cover each region in the instance config.
Multi-regional location KMS keys are not supported for USER_MANAGED
instance configs.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides reference information for the \u003ccode\u003eCreateBackupEncryptionConfig\u003c/code\u003e class within the Google Cloud Spanner Database Administration v1 API, showing the various versions available, from 3.5.0 to the latest beta, 5.0.0-beta05.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCreateBackupEncryptionConfig\u003c/code\u003e class is designed to manage encryption settings for database backups, including defining the type of encryption and specifying the Cloud KMS key used.\u003c/p\u003e\n"],["\u003cp\u003eThis class inherits properties and methods from multiple interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, indicating its role in handling structured data within the API.\u003c/p\u003e\n"],["\u003cp\u003eThe class allows specification of the encryption type, with \u003ccode\u003eCUSTOMER_MANAGED_ENCRYPTION\u003c/code\u003e as an option, as well as specifying one or more KMS keys for protecting the backup, which can also be configured as \u003ccode\u003eCryptoKeyName\u003c/code\u003e resource types.\u003c/p\u003e\n"],["\u003cp\u003eThe provided documentation covers different versions of the class, and offers both constructors for initiating a new instance of the class, along with several properties related to encryption configuration for managing backups in the Spanner database.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner Database Administration v1 API - Class CreateBackupEncryptionConfig (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/latest/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/5.0.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/4.6.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/4.5.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/4.4.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/4.3.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/4.2.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/4.1.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/4.0.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.15.1/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.14.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.13.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.12.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.11.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.10.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.9.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.8.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.7.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.6.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/3.5.0/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig) \n\n public sealed class CreateBackupEncryptionConfig : IMessage\u003cCreateBackupEncryptionConfig\u003e, IEquatable\u003cCreateBackupEncryptionConfig\u003e, IDeepCloneable\u003cCreateBackupEncryptionConfig\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Spanner Database Administration v1 API class CreateBackupEncryptionConfig.\n\nEncryption configuration for the backup to create. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CreateBackupEncryptionConfig \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CreateBackupEncryptionConfig](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/latest/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CreateBackupEncryptionConfig](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/latest/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CreateBackupEncryptionConfig](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/latest/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.Admin.Database.V1](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/latest/Google.Cloud.Spanner.Admin.Database.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.Admin.Database.V1.dll\n\nConstructors\n------------\n\n### CreateBackupEncryptionConfig()\n\n public CreateBackupEncryptionConfig()\n\n### CreateBackupEncryptionConfig(CreateBackupEncryptionConfig)\n\n public CreateBackupEncryptionConfig(CreateBackupEncryptionConfig other)\n\nProperties\n----------\n\n### EncryptionType\n\n public CreateBackupEncryptionConfig.Types.EncryptionType EncryptionType { get; set; }\n\nRequired. The encryption type of the backup.\n\n### KmsKeyName\n\n public string KmsKeyName { get; set; }\n\nOptional. The Cloud KMS key that will be used to protect the backup.\nThis field should be set only when\n\\[encryption_type\\]\\[google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type\\]\nis `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form\n`projects/\u003cproject\u003e/locations/\u003clocation\u003e/keyRings/\u003ckey_ring\u003e/cryptoKeys/\u003ckms_key_name\u003e`.\n\n### KmsKeyNameAsCryptoKeyName\n\n public CryptoKeyName KmsKeyNameAsCryptoKeyName { get; set; }\n\n[CryptoKeyName](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/latest/Google.Cloud.Spanner.Admin.Database.V1.CryptoKeyName)-typed view over the [KmsKeyName](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/latest/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig#Google_Cloud_Spanner_Admin_Database_V1_CreateBackupEncryptionConfig_KmsKeyName) resource name property.\n\n### KmsKeyNames\n\n public RepeatedField\u003cstring\u003e KmsKeyNames { get; }\n\nOptional. Specifies the KMS configuration for the one or more keys used to\nprotect the backup. Values are of the form\n`projects/\u003cproject\u003e/locations/\u003clocation\u003e/keyRings/\u003ckey_ring\u003e/cryptoKeys/\u003ckms_key_name\u003e`.\n\nThe keys referenced by kms_key_names must fully cover all\nregions of the backup's instance configuration. Some examples:\n\n- For single region instance configs, specify a single regional location KMS key.\n- For multi-regional instance configs of type GOOGLE_MANAGED, either specify a multi-regional location KMS key or multiple regional location KMS keys that cover all regions in the instance config.\n- For an instance config of type USER_MANAGED, please specify only regional location KMS keys to cover each region in the instance config. Multi-regional location KMS keys are not supported for USER_MANAGED instance configs.\n\n### KmsKeyNamesAsCryptoKeyNames\n\n public ResourceNameList\u003cCryptoKeyName\u003e KmsKeyNamesAsCryptoKeyNames { get; }\n\n[CryptoKeyName](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/latest/Google.Cloud.Spanner.Admin.Database.V1.CryptoKeyName)-typed view over the [KmsKeyNames](/dotnet/docs/reference/Google.Cloud.Spanner.Admin.Database.V1/latest/Google.Cloud.Spanner.Admin.Database.V1.CreateBackupEncryptionConfig#Google_Cloud_Spanner_Admin_Database_V1_CreateBackupEncryptionConfig_KmsKeyNames) resource name property."]]