Update Encryption at Rest Configuration for One Project
Updates the configuration for encryption at rest using the keys you manage through your cloud provider. MongoDB Cloud encrypts all storage even if you don't use your own key management. This resource requires the requesting Service Account or API Key to have the Project Owner role. This feature isn't available for M0
free clusters, M2
, M5
, or serverless clusters.
After you configure at least one Encryption at Rest using a Customer Key Management provider for the MongoDB Cloud project, Project Owners can enable Encryption at Rest using Customer Key Management for each MongoDB Cloud cluster for which they require encryption. The Encryption at Rest using Customer Key Management provider doesn't have to match the cluster cloud service provider. MongoDB Cloud doesn't automatically rotate user-managed encryption keys. Defer to your preferred Encryption at Rest using Customer Key Management provider's documentation and guidance for best practices on key rotation. MongoDB Cloud automatically creates a 90-day key rotation alert when you configure Encryption at Rest using Customer Key Management using your Key Management in an MongoDB Cloud project. MongoDB Cloud encrypts all storage whether or not you use your own key management.
Path parameters
-
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
Format should match the following pattern:
^([a-f0-9]{24})$
.
Query parameters
-
Flag that indicates whether Application wraps the response in an
envelope
JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.Default value is
false
. -
Flag that indicates whether the response body should be in the prettyprint format.
Default value is
false
.Prettyprint
Body Required
Required parameters depend on whether someone has enabled Encryption at Rest using Customer Key Management:
If you have enabled Encryption at Rest using Customer Key Management (CMK), Atlas requires all of the parameters for the desired encryption provider.
- To use AWS Key Management Service (KMS), MongoDB Cloud requires all the fields in the awsKms object.
- To use Azure Key Vault, MongoDB Cloud requires all the fields in the azureKeyVault object.
- To use Google Cloud Key Management Service (KMS), MongoDB Cloud requires all the fields in the googleCloudKms object.
If you enabled Encryption at Rest using Customer Key Management, administrators can pass only the changed fields for the awsKms, azureKeyVault, or googleCloudKms object to update the configuration to this endpoint.
-
Amazon Web Services (AWS) KMS configuration details and encryption at rest configuration set for the specified project.
Amazon Web Services Key Management Service -
Details that define the configuration of Encryption at Rest using Azure Key Vault (AKV).
Azure Key Vault -
Flag that indicates whether Encryption at Rest for Dedicated Search Nodes is enabled in the specified project.
-
Details that define the configuration of Encryption at Rest using Google Cloud Key Management Service (KMS).
Google Cloud Key Management Service
curl \ --request PATCH 'https://cloud.mongodb.com/api/atlas/v1.0/groups/32b6e34b3d91647abb20e7b8/encryptionAtRest' \ --header "Authorization: Bearer $ACCESS_TOKEN" \ --header "Content-Type: application/json" \ --data '{"awsKms":{"accessKeyID":"019dd98d94b4bb778e7552e4","customerMasterKeyID":"string","enabled":true,"region":"US_GOV_WEST_1","requirePrivateNetworking":true,"roleId":"32b6e34b3d91647abb20e7b8","secretAccessKey":"string"},"azureKeyVault":{"azureEnvironment":"AZURE","clientID":"string","enabled":true,"keyIdentifier":"https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86","keyVaultName":"string","requirePrivateNetworking":true,"resourceGroupName":"string","secret":"string","subscriptionID":"string","tenantID":"string"},"enabledForSearchNodes":true,"googleCloudKms":{"enabled":true,"keyVersionResourceID":"projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1","roleId":"32b6e34b3d91647abb20e7b8","serviceAccountKey":"string"}}'
{ "awsKms": { "accessKeyID": "019dd98d94b4bb778e7552e4", "customerMasterKeyID": "string", "enabled": true, "region": "US_GOV_WEST_1", "requirePrivateNetworking": true, "roleId": "32b6e34b3d91647abb20e7b8", "secretAccessKey": "string" }, "azureKeyVault": { "azureEnvironment": "AZURE", "clientID": "string", "enabled": true, "keyIdentifier": "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86", "keyVaultName": "string", "requirePrivateNetworking": true, "resourceGroupName": "string", "secret": "string", "subscriptionID": "string", "tenantID": "string" }, "enabledForSearchNodes": true, "googleCloudKms": { "enabled": true, "keyVersionResourceID": "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1", "roleId": "32b6e34b3d91647abb20e7b8", "serviceAccountKey": "string" } }
{ "awsKms": { "accessKeyID": "019dd98d94b4bb778e7552e4", "customerMasterKeyID": "string", "enabled": true, "region": "US_GOV_WEST_1", "requirePrivateNetworking": true, "valid": true }, "azureKeyVault": { "azureEnvironment": "AZURE", "clientID": "string", "enabled": true, "keyIdentifier": "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86", "keyVaultName": "string", "requirePrivateNetworking": true, "resourceGroupName": "string", "subscriptionID": "string", "tenantID": "string", "valid": true }, "enabledForSearchNodes": true, "googleCloudKms": { "enabled": true, "keyVersionResourceID": "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1", "roleId": "32b6e34b3d91647abb20e7b8", "valid": true } }
{ "error": 400, "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.", "reason": "Bad Request", "errorCode": "VALIDATION_ERROR" }
{ "error": 401, "detail": "(This is just an example, the exception may not be related to this endpoint)", "reason": "Unauthorized", "errorCode": "NOT_ORG_GROUP_CREATOR" }
{ "error": 403, "detail": "(This is just an example, the exception may not be related to this endpoint)", "reason": "Forbidden", "errorCode": "CANNOT_CHANGE_GROUP_NAME" }
{ "error": 404, "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS", "reason": "Not Found", "errorCode": "RESOURCE_NOT_FOUND" }
{ "error": 409, "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot delete organization link while there is active migration in following project ids: 60c4fd418ebe251047c50554", "reason": "Conflict", "errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK" }
{ "error": 500, "detail": "(This is just an example, the exception may not be related to this endpoint)", "reason": "Internal Server Error", "errorCode": "UNEXPECTED_ERROR" }