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: [Terraform] Create new example for BYOK and multi-region cluster #1349

Merged
merged 25 commits into from
Jul 28, 2023

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Jul 26, 2023

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:

  • 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.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • 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

Further comments

Screenshot 2023-07-26 at 16 24 38

@@ -0,0 +1,84 @@
# Atlas Terraform Provider Example: Encryption at rest - AWS - Cluster
Copy link
Collaborator Author

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
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

new example

Comment on lines +1 to +9
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"
}
Copy link
Collaborator Author

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

@andreaangiolillo andreaangiolillo changed the title INTMDB-340: [Terraform] Create new example for BYOK and multi-region cluster doc: [Terraform] Create new example for BYOK and multi-region cluster Jul 27, 2023
@andreaangiolillo andreaangiolillo marked this pull request as ready for review July 27, 2023 07:40
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner July 27, 2023 07:40
Copy link
Collaborator

@Zuhairahmed Zuhairahmed left a 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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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"
Copy link
Collaborator

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

Copy link
Collaborator Author

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
Copy link
Collaborator Author

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" {

@andreaangiolillo andreaangiolillo merged commit 3e211cf into master Jul 28, 2023
20 checks passed
@andreaangiolillo andreaangiolillo deleted the INTMDB-340 branch July 28, 2023 08:43
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.

None yet

3 participants