EncryptionAtRest
mongodbatlas..EncryptionAtRest Atlas encrypts your data at rest using encrypted storage media.
Using keys you manage with AWS KMS, Atlas encrypts your data a second time when it writes it to the MongoDB encrypted storage engine.
You can use the following clouds: AWS CMK, AZURE KEY VAULT and GOOGLE KEY VAULT to encrypt the MongoDB master encryption keys.
NOTE: Groups and projects are synonymous terms. You may find
groupIdin the official documentation.
Example Usage
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var test = new Mongodbatlas.EncryptionAtRest("test", new Mongodbatlas.EncryptionAtRestArgs
{
AwsKms = new Mongodbatlas.Inputs.EncryptionAtRestAwsKmsArgs
{
Access_key_id = "AKIAIOSFODNN7EXAMPLE",
Customer_master_key_id = "030gce02-586d-48d2-a966-05ea954fde0g",
Enabled = true,
Region = "US_EAST_1",
Secret_access_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
},
AzureKeyVault = new Mongodbatlas.Inputs.EncryptionAtRestAzureKeyVaultArgs
{
Azure_environment = "AZURE",
Client_id = "g54f9e2-89e3-40fd-8188-EXAMPLEID",
Enabled = true,
Key_identifier = "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86",
Key_vault_name = "EXAMPLEKeyVault",
Resource_group_name = "ExampleRGName",
Secret = "EXAMPLESECRET",
Subscription_id = "0ec944e3-g725-44f9-a147-EXAMPLEID",
Tenant_id = "e8e4b6ba-ff32-4c88-a9af-EXAMPLEID",
},
GoogleCloudKms = new Mongodbatlas.Inputs.EncryptionAtRestGoogleCloudKmsArgs
{
Enabled = true,
Key_version_resource_id = "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1",
Service_account_key = "{\"type\": \"service_account\",\"project_id\": \"my-project-common-0\",\"private_key_id\": \"e120598ea4f88249469fcdd75a9a785c1bb3\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEuwIBA(truncated)SfecnS0mT94D9\\n-----END PRIVATE KEY-----\\n\",\"client_email\": \"my-email-kms-0@my-project-common-0.iam.gserviceaccount.com\",\"client_id\": \"10180967717292066\",\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/my-email-kms-0%40my-project-common-0.iam.gserviceaccount.com\"}",
},
ProjectId = "<PROJECT-ID>",
});
}
}
Coming soon!
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.EncryptionAtRest("test",
aws_kms={
"access_key_id": "AKIAIOSFODNN7EXAMPLE",
"customer_master_key_id": "030gce02-586d-48d2-a966-05ea954fde0g",
"enabled": True,
"region": "US_EAST_1",
"secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
},
azure_key_vault={
"azure_environment": "AZURE",
"client_id": "g54f9e2-89e3-40fd-8188-EXAMPLEID",
"enabled": True,
"key_identifier": "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86",
"key_vault_name": "EXAMPLEKeyVault",
"resource_group_name": "ExampleRGName",
"secret": "EXAMPLESECRET",
"subscription_id": "0ec944e3-g725-44f9-a147-EXAMPLEID",
"tenant_id": "e8e4b6ba-ff32-4c88-a9af-EXAMPLEID",
},
google_cloud_kms={
"enabled": True,
"key_version_resource_id": "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1",
"service_account_key": "{\"type\": \"service_account\",\"project_id\": \"my-project-common-0\",\"private_key_id\": \"e120598ea4f88249469fcdd75a9a785c1bb3\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEuwIBA(truncated)SfecnS0mT94D9\\n-----END PRIVATE KEY-----\\n\",\"client_email\": \"my-email-kms-0@my-project-common-0.iam.gserviceaccount.com\",\"client_id\": \"10180967717292066\",\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/my-email-kms-0%40my-project-common-0.iam.gserviceaccount.com\"}",
},
project_id="<PROJECT-ID>")import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.EncryptionAtRest("test", {
awsKms: {
access_key_id: "AKIAIOSFODNN7EXAMPLE",
customer_master_key_id: "030gce02-586d-48d2-a966-05ea954fde0g",
enabled: true,
region: "US_EAST_1",
secret_access_key: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
},
azureKeyVault: {
azure_environment: "AZURE",
client_id: "g54f9e2-89e3-40fd-8188-EXAMPLEID",
enabled: true,
key_identifier: "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86",
key_vault_name: "EXAMPLEKeyVault",
resource_group_name: "ExampleRGName",
secret: "EXAMPLESECRET",
subscription_id: "0ec944e3-g725-44f9-a147-EXAMPLEID",
tenant_id: "e8e4b6ba-ff32-4c88-a9af-EXAMPLEID",
},
googleCloudKms: {
enabled: true,
key_version_resource_id: "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1",
service_account_key: "{\"type\": \"service_account\",\"project_id\": \"my-project-common-0\",\"private_key_id\": \"e120598ea4f88249469fcdd75a9a785c1bb3\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEuwIBA(truncated)SfecnS0mT94D9\\n-----END PRIVATE KEY-----\\n\",\"client_email\": \"my-email-kms-0@my-project-common-0.iam.gserviceaccount.com\",\"client_id\": \"10180967717292066\",\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/my-email-kms-0%40my-project-common-0.iam.gserviceaccount.com\"}",
},
projectId: "<PROJECT-ID>",
});Create a EncryptionAtRest Resource
new EncryptionAtRest(name: string, args: EncryptionAtRestArgs, opts?: CustomResourceOptions);def EncryptionAtRest(resource_name, opts=None, aws_kms=None, azure_key_vault=None, google_cloud_kms=None, project_id=None, __props__=None);func NewEncryptionAtRest(ctx *Context, name string, args EncryptionAtRestArgs, opts ...ResourceOption) (*EncryptionAtRest, error)public EncryptionAtRest(string name, EncryptionAtRestArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args EncryptionAtRestArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args EncryptionAtRestArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EncryptionAtRestArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
EncryptionAtRest Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The EncryptionAtRest resource accepts the following input properties:
- Project
Id string The unique identifier for the project.
- Aws
Kms EncryptionAt Rest Aws Kms Args Specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Azure
Key EncryptionVault At Rest Azure Key Vault Args Specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Google
Cloud EncryptionKms At Rest Google Cloud Kms Args Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Project
Id string The unique identifier for the project.
- Aws
Kms EncryptionAt Rest Aws Kms Specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Azure
Key EncryptionVault At Rest Azure Key Vault Specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Google
Cloud EncryptionKms At Rest Google Cloud Kms Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- project
Id string The unique identifier for the project.
- aws
Kms EncryptionAt Rest Aws Kms Specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- azure
Key EncryptionVault At Rest Azure Key Vault Specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
- google
Cloud EncryptionKms At Rest Google Cloud Kms Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- project_
id str The unique identifier for the project.
- aws_
kms Dict[EncryptionAt Rest Aws Kms] Specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- azure_
key_ Dict[Encryptionvault At Rest Azure Key Vault] Specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
- google_
cloud_ Dict[Encryptionkms At Rest Google Cloud Kms] Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
Outputs
All input properties are implicitly available as output properties. Additionally, the EncryptionAtRest resource produces the following output properties:
Look up an Existing EncryptionAtRest Resource
Get an existing EncryptionAtRest resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: EncryptionAtRestState, opts?: CustomResourceOptions): EncryptionAtReststatic get(resource_name, id, opts=None, aws_kms=None, azure_key_vault=None, google_cloud_kms=None, project_id=None, __props__=None);func GetEncryptionAtRest(ctx *Context, name string, id IDInput, state *EncryptionAtRestState, opts ...ResourceOption) (*EncryptionAtRest, error)public static EncryptionAtRest Get(string name, Input<string> id, EncryptionAtRestState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Aws
Kms EncryptionAt Rest Aws Kms Args Specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Azure
Key EncryptionVault At Rest Azure Key Vault Args Specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Google
Cloud EncryptionKms At Rest Google Cloud Kms Args Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Project
Id string The unique identifier for the project.
- Aws
Kms EncryptionAt Rest Aws Kms Specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Azure
Key EncryptionVault At Rest Azure Key Vault Specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Google
Cloud EncryptionKms At Rest Google Cloud Kms Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- Project
Id string The unique identifier for the project.
- aws
Kms EncryptionAt Rest Aws Kms Specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- azure
Key EncryptionVault At Rest Azure Key Vault Specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
- google
Cloud EncryptionKms At Rest Google Cloud Kms Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- project
Id string The unique identifier for the project.
- aws_
kms Dict[EncryptionAt Rest Aws Kms] Specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- azure_
key_ Dict[Encryptionvault At Rest Azure Key Vault] Specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
- google_
cloud_ Dict[Encryptionkms At Rest Google Cloud Kms] Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
- project_
id str The unique identifier for the project.
Supporting Types
EncryptionAtRestAwsKms
- Access
Key stringId The IAM access key ID with permissions to access the customer master key specified by customerMasterKeyID.
- Customer
Master stringKey Id The AWS customer master key used to encrypt and decrypt the MongoDB master keys.
- Enabled bool
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- Region string
The AWS region in which the AWS customer master key exists: CA_CENTRAL_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, SA_EAST_1
- Secret
Access stringKey The IAM secret access key with permissions to access the customer master key specified by customerMasterKeyID.
- Access
Key stringId The IAM access key ID with permissions to access the customer master key specified by customerMasterKeyID.
- Customer
Master stringKey Id The AWS customer master key used to encrypt and decrypt the MongoDB master keys.
- Enabled bool
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- Region string
The AWS region in which the AWS customer master key exists: CA_CENTRAL_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, SA_EAST_1
- Secret
Access stringKey The IAM secret access key with permissions to access the customer master key specified by customerMasterKeyID.
- access
Key stringId The IAM access key ID with permissions to access the customer master key specified by customerMasterKeyID.
- customer
Master stringKey Id The AWS customer master key used to encrypt and decrypt the MongoDB master keys.
- enabled boolean
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- region string
The AWS region in which the AWS customer master key exists: CA_CENTRAL_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, SA_EAST_1
- secret
Access stringKey The IAM secret access key with permissions to access the customer master key specified by customerMasterKeyID.
- access_
key_ strid The IAM access key ID with permissions to access the customer master key specified by customerMasterKeyID.
- customer_
master_ strkey_ id The AWS customer master key used to encrypt and decrypt the MongoDB master keys.
- enabled bool
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- region str
The AWS region in which the AWS customer master key exists: CA_CENTRAL_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, SA_EAST_1
- secret_
access_ strkey The IAM secret access key with permissions to access the customer master key specified by customerMasterKeyID.
EncryptionAtRestAzureKeyVault
- Azure
Environment string The Azure environment where the Azure account credentials reside. Valid values are the following: AZURE, AZURE_CHINA, AZURE_GERMANY
- Client
Id string The client ID, also known as the application ID, for an Azure application associated with the Azure AD tenant.
- Enabled bool
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- Key
Identifier string The unique identifier of a key in an Azure Key Vault.
- Key
Vault stringName The name of an Azure Key Vault containing your key.
- Resource
Group stringName The name of the Azure Resource group that contains an Azure Key Vault.
- Secret string
The secret associated with the Azure Key Vault specified by azureKeyVault.tenantID.
- Subscription
Id string The unique identifier associated with an Azure subscription.
- Tenant
Id string The unique identifier for an Azure AD tenant within an Azure subscription.
- Azure
Environment string The Azure environment where the Azure account credentials reside. Valid values are the following: AZURE, AZURE_CHINA, AZURE_GERMANY
- Client
Id string The client ID, also known as the application ID, for an Azure application associated with the Azure AD tenant.
- Enabled bool
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- Key
Identifier string The unique identifier of a key in an Azure Key Vault.
- Key
Vault stringName The name of an Azure Key Vault containing your key.
- Resource
Group stringName The name of the Azure Resource group that contains an Azure Key Vault.
- Secret string
The secret associated with the Azure Key Vault specified by azureKeyVault.tenantID.
- Subscription
Id string The unique identifier associated with an Azure subscription.
- Tenant
Id string The unique identifier for an Azure AD tenant within an Azure subscription.
- azure
Environment string The Azure environment where the Azure account credentials reside. Valid values are the following: AZURE, AZURE_CHINA, AZURE_GERMANY
- client
Id string The client ID, also known as the application ID, for an Azure application associated with the Azure AD tenant.
- enabled boolean
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- key
Identifier string The unique identifier of a key in an Azure Key Vault.
- key
Vault stringName The name of an Azure Key Vault containing your key.
- resource
Group stringName The name of the Azure Resource group that contains an Azure Key Vault.
- secret string
The secret associated with the Azure Key Vault specified by azureKeyVault.tenantID.
- subscription
Id string The unique identifier associated with an Azure subscription.
- tenant
Id string The unique identifier for an Azure AD tenant within an Azure subscription.
- azure_
environment str The Azure environment where the Azure account credentials reside. Valid values are the following: AZURE, AZURE_CHINA, AZURE_GERMANY
- client_
id str The client ID, also known as the application ID, for an Azure application associated with the Azure AD tenant.
- enabled bool
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- key_
identifier str The unique identifier of a key in an Azure Key Vault.
- key_
vault_ strname The name of an Azure Key Vault containing your key.
- resource_
group_ strname The name of the Azure Resource group that contains an Azure Key Vault.
- secret str
The secret associated with the Azure Key Vault specified by azureKeyVault.tenantID.
- subscription_
id str The unique identifier associated with an Azure subscription.
- tenant_
id str The unique identifier for an Azure AD tenant within an Azure subscription.
EncryptionAtRestGoogleCloudKms
- Enabled bool
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- Key
Version stringResource Id The Key Version Resource ID from your GCP account.
- Service
Account stringKey String-formatted JSON object containing GCP KMS credentials from your GCP account.
- Enabled bool
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- Key
Version stringResource Id The Key Version Resource ID from your GCP account.
- Service
Account stringKey String-formatted JSON object containing GCP KMS credentials from your GCP account.
- enabled boolean
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- key
Version stringResource Id The Key Version Resource ID from your GCP account.
- service
Account stringKey String-formatted JSON object containing GCP KMS credentials from your GCP account.
- enabled bool
Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
- key_
version_ strresource_ id The Key Version Resource ID from your GCP account.
- service_
account_ strkey String-formatted JSON object containing GCP KMS credentials from your GCP account.
Package Details
- Repository
- https://github.com/pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlasTerraform Provider.