Reference documentation and code samples for the Secret Manager V1 API class Google::Cloud::SecretManager::V1::CustomerManagedEncryption.
Configuration for encrypting secret payloads using customer-managed
encryption keys (CMEK).
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#kms_key_name
defkms_key_name()->::String
Returns
(::String) — Required. The resource name of the Cloud KMS CryptoKey used to encrypt
secret payloads.
For secrets using the
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
replication policy type, Cloud KMS CryptoKeys must reside in global.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
#kms_key_name=
defkms_key_name=(value)->::String
Parameter
value (::String) — Required. The resource name of the Cloud KMS CryptoKey used to encrypt
secret payloads.
For secrets using the
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
replication policy type, Cloud KMS CryptoKeys must reside in global.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
Returns
(::String) — Required. The resource name of the Cloud KMS CryptoKey used to encrypt
secret payloads.
For secrets using the
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
replication policy type, Cloud KMS CryptoKeys must reside in global.
The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
[[["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-09-09 UTC."],[],[],null,["# Secret Manager V1 API - Class Google::Cloud::SecretManager::V1::CustomerManagedEncryption (v1.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.0 (latest)](/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [1.3.0](/ruby/docs/reference/google-cloud-secret_manager-v1/1.3.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [1.2.1](/ruby/docs/reference/google-cloud-secret_manager-v1/1.2.1/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [1.1.0](/ruby/docs/reference/google-cloud-secret_manager-v1/1.1.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [1.0.1](/ruby/docs/reference/google-cloud-secret_manager-v1/1.0.1/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.21.0](/ruby/docs/reference/google-cloud-secret_manager-v1/0.21.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.20.0](/ruby/docs/reference/google-cloud-secret_manager-v1/0.20.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.19.2](/ruby/docs/reference/google-cloud-secret_manager-v1/0.19.2/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.18.0](/ruby/docs/reference/google-cloud-secret_manager-v1/0.18.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.17.2](/ruby/docs/reference/google-cloud-secret_manager-v1/0.17.2/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.16.0](/ruby/docs/reference/google-cloud-secret_manager-v1/0.16.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.15.0](/ruby/docs/reference/google-cloud-secret_manager-v1/0.15.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.14.0](/ruby/docs/reference/google-cloud-secret_manager-v1/0.14.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.13.0](/ruby/docs/reference/google-cloud-secret_manager-v1/0.13.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.12.0](/ruby/docs/reference/google-cloud-secret_manager-v1/0.12.0/Google-Cloud-SecretManager-V1-CustomerManagedEncryption)\n- [0.11.3](/ruby/docs/reference/google-cloud-secret_manager-v1/0.11.3/Google-Cloud-SecretManager-V1-CustomerManagedEncryption) \nReference documentation and code samples for the Secret Manager V1 API class Google::Cloud::SecretManager::V1::CustomerManagedEncryption.\n\nConfiguration for encrypting secret payloads using customer-managed\nencryption keys (CMEK). \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #kms_key_name\n\n def kms_key_name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.\n\n For secrets using the\n [UserManaged](/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-Replication-UserManaged \"Google::Cloud::SecretManager::V1::Replication::UserManaged (class)\")\n replication policy type, Cloud KMS CryptoKeys must reside in the same\n location as the \\[replica location\\]\\[Secret.UserManaged.Replica.location\\].\n\n For secrets using the\n [Automatic](/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-Replication-Automatic \"Google::Cloud::SecretManager::V1::Replication::Automatic (class)\")\n replication policy type, Cloud KMS CryptoKeys must reside in `global`.\n\n The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.\n\n### #kms_key_name=\n\n def kms_key_name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.\n\n\n For secrets using the\n [UserManaged](/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-Replication-UserManaged \"Google::Cloud::SecretManager::V1::Replication::UserManaged (class)\")\n replication policy type, Cloud KMS CryptoKeys must reside in the same\n location as the \\[replica location\\]\\[Secret.UserManaged.Replica.location\\].\n\n For secrets using the\n [Automatic](/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-Replication-Automatic \"Google::Cloud::SecretManager::V1::Replication::Automatic (class)\")\n replication policy type, Cloud KMS CryptoKeys must reside in `global`.\n\nThe expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. \n**Returns**\n\n- (::String) --- Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret payloads.\n\n For secrets using the\n [UserManaged](/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-Replication-UserManaged \"Google::Cloud::SecretManager::V1::Replication::UserManaged (class)\")\n replication policy type, Cloud KMS CryptoKeys must reside in the same\n location as the \\[replica location\\]\\[Secret.UserManaged.Replica.location\\].\n\n For secrets using the\n [Automatic](/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-Replication-Automatic \"Google::Cloud::SecretManager::V1::Replication::Automatic (class)\")\n replication policy type, Cloud KMS CryptoKeys must reside in `global`.\n\n The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`."]]