-
Notifications
You must be signed in to change notification settings - Fork 178
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: Adds documentation for new encryption_at_rest_private_endpoint
resource and data sources
#2547
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b68aec7
adding documentation for encryption_at_rest_private_endpoint resource…
AgustinBettati d0afa6c
align generated docs
AgustinBettati fa5041a
minor typo fix
AgustinBettati 1fd30ab
Adjust description of project_id to make it more concise
AgustinBettati c74030d
align note stating feature is available by request as defined in gene…
AgustinBettati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Data Source: mongodbatlas_encryption_at_rest_private_endpoint | ||
|
||
`mongodbatlas_encryption_at_rest_private_endpoint` describes a private endpoint used for encryption at rest using customer-managed keys. | ||
|
||
## Example Usages | ||
|
||
```terraform | ||
data "mongodbatlas_encryption_at_rest_private_endpoint" "single" { | ||
project_id = var.atlas_project_id | ||
cloud_provider = "AZURE" | ||
id = mongodbatlas_encryption_at_rest_private_endpoint.endpoint.id | ||
} | ||
|
||
output "endpoint_connection_name" { | ||
value = data.mongodbatlas_encryption_at_rest_private_endpoint.single.private_endpoint_connection_name | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cloud_provider` (String) Label that identifies the cloud provider of the private endpoint. | ||
- `id` (String) Unique 24-hexadecimal digit string that identifies the Private Endpoint Service. | ||
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. | ||
|
||
### Read-Only | ||
|
||
- `error_message` (String) Error message for failures associated with the Encryption At Rest private endpoint. | ||
- `private_endpoint_connection_name` (String) Connection name of the Azure Private Endpoint. | ||
- `region_name` (String) Cloud provider region in which the Encryption At Rest private endpoint is located. | ||
- `status` (String) State of the Encryption At Rest private endpoint. | ||
|
||
For more information see: | ||
- [MongoDB Atlas API - Private Endpoint for Encryption at Rest Using Customer Key Management](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/getEncryptionAtRestPrivateEndpoint) Documentation. | ||
- [Manage Customer Keys with Azure Key Vault Over Private Endpoints](https://www.mongodb.com/docs/atlas/security/azure-kms-over-private-endpoint/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Data Source: mongodbatlas_encryption_at_rest_private_endpoints | ||
|
||
`mongodbatlas_encryption_at_rest_private_endpoints` describes private endpoints of a particular cloud provider used for encryption at rest using customer-managed keys. | ||
|
||
## Example Usages | ||
|
||
```terraform | ||
data "mongodbatlas_encryption_at_rest_private_endpoints" "plural" { | ||
project_id = var.atlas_project_id | ||
cloud_provider = "AZURE" | ||
} | ||
|
||
output "number_of_endpoints" { | ||
value = length(data.mongodbatlas_encryption_at_rest_private_endpoints.plural.results) | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cloud_provider` (String) Human-readable label that identifies the cloud provider for the private endpoints to return. | ||
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. | ||
|
||
### Read-Only | ||
|
||
- `results` (Attributes List) List of returned documents that MongoDB Cloud providers when completing this request. (see [below for nested schema](#nestedatt--results)) | ||
|
||
<a id="nestedatt--results"></a> | ||
### Nested Schema for `results` | ||
|
||
Read-Only: | ||
|
||
- `cloud_provider` (String) Label that identifies the cloud provider of the private endpoint. | ||
- `error_message` (String) Error message for failures associated with the Encryption At Rest private endpoint. | ||
- `id` (String) Unique 24-hexadecimal digit string that identifies the Private Endpoint Service. | ||
- `private_endpoint_connection_name` (String) Connection name of the Azure Private Endpoint. | ||
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. | ||
- `region_name` (String) Cloud provider region in which the Encryption At Rest private endpoint is located. | ||
- `status` (String) State of the Encryption At Rest private endpoint. | ||
|
||
For more information see: | ||
- [MongoDB Atlas API - Private Endpoint for Encryption at Rest Using Customer Key Management](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/getEncryptionAtRestPrivateEndpointsForCloudProvider) Documentation. | ||
- [Manage Customer Keys with Azure Key Vault Over Private Endpoints](https://www.mongodb.com/docs/atlas/security/azure-kms-over-private-endpoint/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Resource: mongodbatlas_encryption_at_rest_private_endpoint | ||
|
||
`mongodbatlas_encryption_at_rest_private_endpoint` provides a resource for managing a private endpoint used for encryption at rest with customer-managed keys. This ensures all traffic between Atlas and customer key management systems take place over private network interfaces. | ||
|
||
~> **IMPORTANT** The Encryption at Rest using Azure Key Vault over Private Endpoints feature is available by request. To request this functionality for you Atlas deployments, contact your Account Manager. | ||
Additionally, you'll need to set the environment variable `MONGODB_ATLAS_ENABLE_PREVIEW=true` to use this resource. To learn more about existing limitations, see the [Manage Customer Keys with Azure Key Vault Over Private Endpoints](https://www.mongodb.com/docs/atlas/security/azure-kms-over-private-endpoint/#manage-customer-keys-with-azure-key-vault-over-private-endpoints). | ||
|
||
-> **NOTE:** Only Azure Key Vault with Azure Private Link is supported at this time. | ||
|
||
## Example Usages | ||
|
||
### Configuring Atlas Encryption at Rest using Azure Key Vault with Azure Private Link | ||
|
||
```terraform | ||
resource "mongodbatlas_encryption_at_rest" "ear" { | ||
project_id = var.atlas_project_id | ||
|
||
azure_key_vault_config { | ||
require_private_networking = true | ||
|
||
enabled = true | ||
azure_environment = "AZURE" | ||
|
||
tenant_id = var.azure_tenant_id | ||
subscription_id = var.azure_subscription_id | ||
client_id = var.azure_client_id | ||
secret = var.azure_client_secret | ||
|
||
resource_group_name = var.azure_resource_group_name | ||
key_vault_name = var.azure_key_vault_name | ||
key_identifier = var.azure_key_identifier | ||
} | ||
} | ||
|
||
# Creates private endpoint | ||
resource "mongodbatlas_encryption_at_rest_private_endpoint" "endpoint" { | ||
project_id = mongodbatlas_encryption_at_rest.ear.project_id | ||
cloud_provider = "AZURE" | ||
region_name = var.azure_region_name | ||
} | ||
|
||
locals { | ||
key_vault_resource_id = "/subscriptions/${var.azure_subscription_id}/resourceGroups/${var.azure_resource_group_name}/providers/Microsoft.KeyVault/vaults/${var.azure_key_vault_name}" | ||
} | ||
|
||
# Approves private endpoint connection from Azure Key Vault | ||
resource "azapi_update_resource" "approval" { | ||
type = "Microsoft.KeyVault/Vaults/PrivateEndpointConnections@2023-07-01" | ||
name = mongodbatlas_encryption_at_rest_private_endpoint.endpoint.private_endpoint_connection_name | ||
parent_id = local.key_vault_resource_id | ||
|
||
body = jsonencode({ | ||
properties = { | ||
privateLinkServiceConnectionState = { | ||
description = "Approved via Terraform" | ||
status = "Approved" | ||
} | ||
} | ||
}) | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cloud_provider` (String) Label that identifies the cloud provider for the Encryption At Rest private endpoint. | ||
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. | ||
- `region_name` (String) Cloud provider region in which the Encryption At Rest private endpoint is located. | ||
|
||
### Read-Only | ||
|
||
- `error_message` (String) Error message for failures associated with the Encryption At Rest private endpoint. | ||
- `id` (String) Unique 24-hexadecimal digit string that identifies the Private Endpoint Service. | ||
- `private_endpoint_connection_name` (String) Connection name of the Azure Private Endpoint. | ||
- `status` (String) State of the Encryption At Rest private endpoint. | ||
|
||
# Import | ||
Encryption At Rest Private Endpoint resource can be imported using the project ID, cloud provider, and private endpoint ID. The format must be `{project_id}-{cloud_provider}-{private_endpoint_id}` e.g. | ||
|
||
``` | ||
$ terraform import mongodbatlas_encryption_at_rest_private_endpoint.test 650972848269185c55f40ca1-AZURE-650972848269185c55f40ca2 | ||
``` | ||
|
||
For more information see: | ||
- [MongoDB Atlas API - Private Endpoint for Encryption at Rest Using Customer Key Management](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/getEncryptionAtRestPrivateEndpoint) Documentation. | ||
- [Manage Customer Keys with Azure Key Vault Over Private Endpoints](https://www.mongodb.com/docs/atlas/security/azure-kms-over-private-endpoint/). |
8 changes: 8 additions & 0 deletions
8
examples/mongodbatlas_encryption_at_rest_private_endpoint/azure/plural-data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
data "mongodbatlas_encryption_at_rest_private_endpoints" "plural" { | ||
project_id = var.atlas_project_id | ||
cloud_provider = "AZURE" | ||
} | ||
|
||
output "number_of_endpoints" { | ||
value = length(data.mongodbatlas_encryption_at_rest_private_endpoints.plural.results) | ||
} |
9 changes: 9 additions & 0 deletions
9
examples/mongodbatlas_encryption_at_rest_private_endpoint/azure/singular-data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
data "mongodbatlas_encryption_at_rest_private_endpoint" "single" { | ||
project_id = var.atlas_project_id | ||
cloud_provider = "AZURE" | ||
id = mongodbatlas_encryption_at_rest_private_endpoint.endpoint.id | ||
} | ||
|
||
output "endpoint_connection_name" { | ||
value = data.mongodbatlas_encryption_at_rest_private_endpoint.single.private_endpoint_connection_name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,17 +12,17 @@ func PluralDataSourceSchema(ctx context.Context) schema.Schema { | |
Attributes: map[string]schema.Attribute{ | ||
"cloud_provider": schema.StringAttribute{ | ||
Required: true, | ||
Description: "Human-readable label that identifies the cloud provider for the private endpoints to return.", | ||
Description: "Label that identifies the cloud provider for the private endpoints to return.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aligns with feedback provided by docs team on the resource. |
||
MarkdownDescription: "Human-readable label that identifies the cloud provider for the private endpoints to return.", | ||
}, | ||
"project_id": schema.StringAttribute{ | ||
Required: true, | ||
Description: "Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.\n\n**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.", | ||
MarkdownDescription: "Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.\n\n**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.", | ||
Description: "Unique 24-hexadecimal digit string that identifies your project.", | ||
MarkdownDescription: "Unique 24-hexadecimal digit string that identifies your project.", | ||
}, | ||
"results": schema.ListNestedAttribute{ | ||
NestedObject: schema.NestedAttributeObject{ | ||
Attributes: DSAttributes(true), | ||
Attributes: DSAttributes(false), | ||
}, | ||
Computed: true, | ||
Description: "List of returned documents that MongoDB Cloud providers when completing this request.", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
templates/data-sources/encryption_at_rest_private_endpoint.md.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# {{.Type}}: {{.Name}} | ||
|
||
`{{.Name}}` describes a private endpoint used for encryption at rest using customer-managed keys. | ||
|
||
## Example Usages | ||
|
||
{{ tffile (printf "examples/%s/azure/singular-data-source.tf" .Name )}} | ||
|
||
{{ .SchemaMarkdown | trimspace }} | ||
|
||
For more information see: | ||
- [MongoDB Atlas API - Private Endpoint for Encryption at Rest Using Customer Key Management](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/getEncryptionAtRestPrivateEndpoint) Documentation. | ||
- [Manage Customer Keys with Azure Key Vault Over Private Endpoints](https://www.mongodb.com/docs/atlas/security/azure-kms-over-private-endpoint/). |
13 changes: 13 additions & 0 deletions
13
templates/data-sources/encryption_at_rest_private_endpoints.md.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# {{.Type}}: {{.Name}} | ||
|
||
`{{.Name}}` describes private endpoints of a particular cloud provider used for encryption at rest using customer-managed keys. | ||
|
||
## Example Usages | ||
|
||
{{ tffile ("examples/mongodbatlas_encryption_at_rest_private_endpoint/azure/plural-data-source.tf") }} | ||
|
||
{{ .SchemaMarkdown | trimspace }} | ||
|
||
For more information see: | ||
- [MongoDB Atlas API - Private Endpoint for Encryption at Rest Using Customer Key Management](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/getEncryptionAtRestPrivateEndpointsForCloudProvider) Documentation. | ||
- [Manage Customer Keys with Azure Key Vault Over Private Endpoints](https://www.mongodb.com/docs/atlas/security/azure-kms-over-private-endpoint/). |
27 changes: 27 additions & 0 deletions
27
templates/resources/encryption_at_rest_private_endpoint.md.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# {{.Type}}: {{.Name}} | ||
|
||
`{{.Name}}` provides a resource for managing a private endpoint used for encryption at rest with customer-managed keys. This ensures all traffic between Atlas and customer key management systems take place over private network interfaces. | ||
|
||
~> **IMPORTANT** The Encryption at Rest using Azure Key Vault over Private Endpoints feature is available by request. To request this functionality for you Atlas deployments, contact your Account Manager. | ||
Additionally, you'll need to set the environment variable `MONGODB_ATLAS_ENABLE_PREVIEW=true` to use this resource. To learn more about existing limitations, see the [Manage Customer Keys with Azure Key Vault Over Private Endpoints](https://www.mongodb.com/docs/atlas/security/azure-kms-over-private-endpoint/#manage-customer-keys-with-azure-key-vault-over-private-endpoints). | ||
|
||
-> **NOTE:** Only Azure Key Vault with Azure Private Link is supported at this time. | ||
|
||
## Example Usages | ||
|
||
### Configuring Atlas Encryption at Rest using Azure Key Vault with Azure Private Link | ||
|
||
{{ tffile (printf "examples/%s/azure/main.tf" .Name )}} | ||
|
||
{{ .SchemaMarkdown | trimspace }} | ||
|
||
# Import | ||
Encryption At Rest Private Endpoint resource can be imported using the project ID, cloud provider, and private endpoint ID. The format must be `{project_id}-{cloud_provider}-{private_endpoint_id}` e.g. | ||
|
||
``` | ||
$ terraform import mongodbatlas_encryption_at_rest_private_endpoint.test 650972848269185c55f40ca1-AZURE-650972848269185c55f40ca2 | ||
``` | ||
|
||
For more information see: | ||
- [MongoDB Atlas API - Private Endpoint for Encryption at Rest Using Customer Key Management](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/getEncryptionAtRestPrivateEndpoint) Documentation. | ||
- [Manage Customer Keys with Azure Key Vault Over Private Endpoints](https://www.mongodb.com/docs/atlas/security/azure-kms-over-private-endpoint/). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice to pass param