-
Notifications
You must be signed in to change notification settings - Fork 167
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: [Terraform] Create new example for BYOK and multi-region cluster #1349
Conversation
@@ -0,0 +1,84 @@ | |||
# Atlas Terraform Provider Example: Encryption at rest - AWS - Cluster |
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.
I moved the old example under the cluster folder and created the README.md
@@ -0,0 +1,67 @@ | |||
# Atlas Terraform Provider Example: Encryption at rest - AWS - Multi-Region Cluster |
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.
new example
module "multi-region-cluster" { | ||
atlas_project_id = mongodbatlas_encryption_at_rest.test.project_id | ||
provider_name = "AWS" | ||
aws_region_shard_1 = var.aws_region_shard_1 | ||
aws_region_shard_2 = var.aws_region_shard_2 | ||
cluster_name = var.cluster_name | ||
instance_size = "M10" | ||
source = "./modules/multi-region-cluster" | ||
} |
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.
the example uses a terraform module defined within the example
examples/atlas-api-key/create-api-key-assign-to-multiple-projects/versions.tf
Show resolved
Hide resolved
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.
Minor comments, not blocking. otherwise LGTM
@@ -181,7 +181,7 @@ resource "mongodbatlas_advanced_cluster" "cluster" { | |||
node_count = 1 | |||
} | |||
provider_name = "GCP" | |||
priority = 0 | |||
priority = 5 |
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.
just curious, why are we changing advanced cluster priority in this doc example?
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.
sure, 0 is not a valid value for the priority. Getting this error
│ Error: error creating MongoDB ClusterAdvanced: POST https://cloud-dev.mongodb.com/api/atlas/v1.5/groups/63f4d4a47baeac59406dc131/clusters: 400 (request "INVALID_ATTRIBUTE") Invalid attribute electable region priority specified.
│
│ with mongodbatlas_advanced_cluster.cluster,
│ on main.tf line 1, in resource "mongodbatlas_advanced_cluster" "cluster":
│ 1: resource "mongodbatlas_advanced_cluster" "cluster" {
@@ -181,7 +181,7 @@ resource "mongodbatlas_advanced_cluster" "cluster" { | |||
node_count = 1 | |||
} | |||
provider_name = "GCP" | |||
priority = 0 | |||
priority = 5 | |||
region_name = "US_EAST_4" |
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.
also can you confirm if we need to update priorities on cluster page as well? https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster
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.
no, the examples have the correct priority
@@ -48,7 +48,7 @@ resource "mongodbatlas_advanced_cluster" "test" { | |||
node_count = 1 | |||
} | |||
provider_name = "AWS" | |||
priority = 1 | |||
priority = 7 |
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.
Error: error creating MongoDB ClusterAdvanced: POST https://cloud-dev.mongodb.com/api/atlas/v1.5/groups/63f4d4a47baeac59406dc131/clusters: 400 (request "ATLAS_GENERAL_ERROR") Reason: A replication spec must specify a region with priority 7.
│
│ with mongodbatlas_advanced_cluster.test,
│ on main.tf line 60, in resource "mongodbatlas_advanced_cluster" "test":
│ 60: resource "mongodbatlas_advanced_cluster" "test" {
Description
This PR adds a new example of encryption at rest with a multi-region cluster defined as a terraform module.
Link to any related issue(s): INTMDB-340
Type of change:
Required Checklist:
Further comments