Skip to content

Commit 0b58372

Browse files
nikhil-mongoNikhil Singh
andauthored
remove unnecessary variables and use roles instead of keys for AWS Encryption-AtRest (#441)
* remove unnecessary variables and use roles instead of keys for AWS Encryption-AtRest * doc update for encryption at rest resource * update the link to example Co-authored-by: Nikhil Singh <[email protected]>
1 parent 7c9f1ae commit 0b58372

File tree

5 files changed

+3
-25
lines changed

5 files changed

+3
-25
lines changed

examples/atlas-encryptionAtRest-roles-one-step-workaround/second_step/atlas-encryption.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ resource "mongodbatlas_encryption_at_rest" "test" {
22
project_id = var.project_id
33

44
aws_kms = {
5-
access_key_id = var.access_key
6-
secret_access_key = var.secret_key
75
enabled = true
86
customer_master_key_id = var.customer_master_key
97
region = var.atlas_region

examples/atlas-encryptionAtRest-roles-one-step-workaround/second_step/variables.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,3 @@ variable "cpa_role_id" {
2323
description = "AWS IAM ROLE ARN"
2424
default = ""
2525
}
26-
variable "access_key" {
27-
description = "The access key for AWS Account"
28-
default = ""
29-
}
30-
variable "secret_key" {
31-
description = "The secret key for AWS Account"
32-
default = ""
33-
}

examples/atlas-encryptionAtRest-roles-two-step/second_step/atlas-encryption.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ resource "mongodbatlas_encryption_at_rest" "test" {
22
project_id = var.project_id
33

44
aws_kms = {
5-
access_key_id = var.access_key
6-
secret_access_key = var.secret_key
75
enabled = true
86
customer_master_key_id = var.customer_master_key
97
region = var.atlas_region

examples/atlas-encryptionAtRest-roles-two-step/second_step/variables.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,3 @@ variable "cpa_role_id" {
2323
description = "AWS IAM ROLE ARN"
2424
default = ""
2525
}
26-
variable "access_key" {
27-
description = "The access key for AWS Account"
28-
default = ""
29-
}
30-
variable "secret_key" {
31-
description = "The secret key for AWS Account"
32-
default = ""
33-
}

website/docs/r/encryption_at_rest.html.markdown

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ resource "mongodbatlas_encryption_at_rest" "test" {
3232
3333
aws_kms = {
3434
enabled = true
35-
access_key_id = "AKIAIOSFODNN7EXAMPLE"
36-
secret_access_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
37-
customer_master_key_id = "030gce02-586d-48d2-a966-05ea954fde0g"
35+
customer_master_key_id = "5ce83906-6563-46b7-8045-11c20e3a5766"
3836
region = "US_EAST_1"
37+
role_id = "60815e2fe01a49138a928ebb"
3938
}
4039
4140
azure_key_vault = {
@@ -66,9 +65,8 @@ resource "mongodbatlas_encryption_at_rest" "test" {
6665
* `google_cloud_kms` - (Required) Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
6766

6867
### aws_kms
68+
Refer to the example in the [official github repository](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples) to implement Encryption at Rest
6969
* `enabled` - 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.
70-
* `access_key_id` - The IAM access key ID with permissions to access the customer master key specified by customerMasterKeyID.
71-
* `secret_access_key` - The IAM secret access key with permissions to access the customer master key specified by customerMasterKeyID.
7270
* `customer_master_key_id` - The AWS customer master key used to encrypt and decrypt the MongoDB master keys.
7371
* `region` - 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
7472
* `role_id` - ID of an AWS IAM role authorized to manage an AWS customer master key. To find the ID for an existing IAM role check the `role_id` attribute of the `mongodbatlas_cloud_provider_access` resource.

0 commit comments

Comments
 (0)