Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Add example & documentation for mongodbatlas_encryption_at_rest_private_endpoint to specify AWS usage #2999

Open
wants to merge 12 commits into
base: CLOUDP-262752-ear-aws-kms-dev
Choose a base branch
from

Conversation

maastha
Copy link
Collaborator

@maastha maastha commented Jan 23, 2025

Description

Add example & documentation for mongodbatlas_encryption_at_rest_private_endpoint to specify AWS usage

Link to any related issue(s): CLOUDP-296238

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@@ -5,27 +5,34 @@
~> **IMPORTANT** The Encryption at Rest using Azure Key Vault over Private Endpoints feature is available by request. To request this functionality for your Atlas deployments, contact your Account Manager.
Copy link
Collaborator Author

@maastha maastha Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Awaiting response for correct messaging here from upstream

@@ -5,13 +5,13 @@
~> **IMPORTANT** The Encryption at Rest using Azure Key Vault over Private Endpoints feature is available by request. To request this functionality for your Atlas deployments, contact your Account Manager.
Copy link
Collaborator Author

@maastha maastha Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Awaiting response for correct messaging here from upstream


**1\. Ensure that Encryption At Rest AWS KMS Private Endpoint feature is available for your project.**

The Encryption at Rest using AWS KMS over Private Endpoints feature is available by request. To request this functionality for your Atlas deployments, contact your Account Manager.
Copy link
Collaborator Author

@maastha maastha Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Awaiting response for correct messaging here from upstream

@maastha maastha marked this pull request as ready for review January 23, 2025 23:12
@maastha maastha requested review from a team as code owners January 23, 2025 23:12
Copy link
Contributor

APIx bot: a message has been sent to Docs Slack channel

Copy link
Member

@AgustinBettati AgustinBettati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Base automatically changed from CLOUDP-295878-ear-pe to CLOUDP-262752-ear-aws-kms-dev January 24, 2025 11:32
@@ -0,0 +1,8 @@
data "mongodbatlas_encryption_at_rest_private_endpoints" "plural" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the data-sources in separate files?

This project will execute the following changes to acheive successful encryption at rest over AWS PrivateLink for customer managed keys:

- Configure encryption at rest in an existing project using a custom AWS KMS Key. For successful private networking configuration, the `requires_private_networking` attribute in `mongodbatlas_encryption_at_rest.aws_kms_config` is set to `true`.
- Create a private endpoint for the existing project under a certain AWS region using `mongodbatlas_encryption_at_rest_private_endpoint`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool that there is no requirement of creating any AWS resources other than IAM Role

@@ -22,7 +22,7 @@
### Configuring encryption at rest using customer key management in Azure
{{ tffile (printf "examples/%s/azure/main.tf" .Name )}}

-> **NOTE:** It is possible to configure Atlas Encryption at Rest to communicate with Azure Key Vault using Azure Private Link, ensuring that all traffic between Atlas and Key Vault takes place over Azure’s private network interfaces. Please review `mongodbatlas_encryption_at_rest_private_endpoint` resource for details.
-> **NOTE:** It is possible to configure Atlas Encryption at Rest to communicate with Customer Managed Keys (Azure Key Vault or AWS KMS) over private network interfaces (Azure Private Link or AWS PrivateLinK). This requires enabling `azure_key_vault_config.require_private_networking` or `aws_kms_config.require_private_networking` attribute, together with the configuration of `mongodbatlas_encryption_at_rest_private_endpoint` resource. Please review `mongodbatlas_encryption_at_rest_private_endpoint` resource for details.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: PrivateLinK


{{ tffile (printf "examples/%s/azure/singular-data-source.tf" .Name )}}

### Encryption At Rest AWS KMS Private Endpoint
{{ tffile (printf "examples/%s/aws/singular-data-source.tf" .Name )}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha. I see the usage of separate files for data sources now 😅.
Would be cool if we had a custom directive tffile_resource so we don't need separate files in the examples

@@ -47,9 +47,9 @@ resource "mongodbatlas_encryption_at_rest" "default" {
{{ tffile (printf "examples/%s/azure/main.tf" .Name )}}

#### Manage Customer Keys with Azure Key Vault Over Private Endpoints
It is possible to configure Atlas Encryption at Rest to communicate with Azure Key Vault using Azure Private Link, ensuring that all traffic between Atlas and Key Vault takes place over Azure’s private network interfaces. This requires enabling `azure_key_vault_config.require_private_networking` attribute, together with the configuration of `mongodbatlas_encryption_at_rest_private_endpoint` resource.
It is possible to configure Atlas Encryption at Rest to communicate with Customer Managed Keys (Azure Key Vault or AWS KMS) over private network interfaces (Azure Private Link or AWS PrivateLinK). This requires enabling `azure_key_vault_config.require_private_networking` or `aws_kms_config.require_private_networking` attribute, together with the configuration of `mongodbatlas_encryption_at_rest_private_endpoint` resource.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same typo: uppercase K

Copy link
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants