-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INTMDB-32: Add example for NVME upgrade (#1037)
* Update CHANGELOG.md * Chore(deps): Bump golangci/golangci-lint-action from 3.3.1 to 3.4.0 (#1026) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.3.1 to 3.4.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@v3.3.1...v3.4.0) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add example for NVME upgrade * Update examples/atlas-cluster/nvme-upgrade/README.md Co-authored-by: Zuhair Ahmed <[email protected]> * Update examples/atlas-cluster/nvme-upgrade/README.md Co-authored-by: Zuhair Ahmed <[email protected]> * Update examples/atlas-cluster/nvme-upgrade/README.md Co-authored-by: Zuhair Ahmed <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Zuhair Ahmed <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2e6bcd1
commit e12584c
Showing
4 changed files
with
98 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# MongoDB Atlas Provider -- Cluster NVME (Non-Volatile Memory Express) Upgrade | ||
This example creates a project and cluster. It is intended to show how to upgrade from Standard, to PROVISIONED storage tier. | ||
|
||
Variables Required: | ||
- `atlas_org_id`: ID of the Atlas organization | ||
- `public_key`: Atlas public key | ||
- `private_key`: Atlas private key | ||
- `provider_name`: Name of provider to use for cluster (TENANT, AWS, GCP) | ||
- `backing_provider_name`: If provider_name is tenant, the backing provider (AWS, GCP) | ||
- `provider_instance_size_name`: Size of the cluster (Shared: M0, M2, M5, Dedicated: M10+.) | ||
- `provider_volume_type`: Provider storage type STANDARD vs PROVISIONED (NVME) | ||
- `provider_disk_iops`: The maximum input/output operations per second (IOPS) the system can perform. The possible values depend on the selected `provider_instance_size_name` and `disk_size_gb`. This setting requires that `provider_instance_size_name` to be M30 or greater and cannot be used with clusters with local NVMe SSDs. The default value for `provider_disk_iops` is the same as the cluster tier's Standard IOPS value, as viewable in the Atlas console. It is used in cases where a higher number of IOPS is needed and possible. If a value is submitted that is lower or equal to the default IOPS value for the cluster tier Atlas ignores the requested value and uses the default. More details available under the providerSettings.diskIOPS parameter: [MongoDB API Clusters](https://docs.atlas.mongodb.com/reference/api/clusters-create-one/) | ||
* You do not need to configure IOPS for a STANDARD disk configuration but only for a PROVISIONED configuration. | ||
|
||
For this example, first we'll start out on the standard tier, then upgrade to a NVME storage tier. | ||
|
||
|
||
Utilize the following to execute a working example, replacing the org id, public and private key with your values: | ||
|
||
Apply with the following `terraform.tfvars` to first create a shared tier cluster: | ||
``` | ||
atlas_org_id = "627a9687f7f7f7f774de306f14" | ||
public_key = <REDACTED> | ||
private_key = <REDACTED> | ||
provider_name = "AWS" | ||
provider_instance_size_name = "M40" | ||
provider_volume_type = "STANDARD" | ||
provider_disk_iops = 3000 | ||
``` | ||
|
||
Apply with the following `terraform.tfvars` to upgrade the standard storage tier cluster you just created to provisioned storage NVME tier: | ||
``` | ||
atlas_org_id = "627a9687f7f7f7f774de306f14" | ||
public_key = <REDACTED> | ||
private_key = <REDACTED> | ||
provider_name = "AWS" | ||
provider_instance_size_name = "M40_NVME" | ||
provider_volume_type = "PROVISIONED" | ||
provider_disk_iops = 135125 | ||
``` |
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,21 @@ | ||
provider "mongodbatlas" { | ||
public_key = var.public_key | ||
private_key = var.private_key | ||
} | ||
|
||
resource "mongodbatlas_cluster" "cluster" { | ||
project_id = mongodbatlas_project.project.id | ||
name = "NVMEToUpgrade" | ||
cluster_type = "REPLICASET" | ||
provider_name = var.provider_name | ||
provider_region_name = "US_EAST_1" | ||
provider_instance_size_name = var.provider_instance_size_name | ||
provider_volume_type = var.provider_volume_type | ||
provider_disk_iops = var.provider_disk_iops | ||
cloud_backup = true | ||
} | ||
|
||
resource "mongodbatlas_project" "project" { | ||
name = "NVMEUpgradeTest" | ||
org_id = var.atlas_org_id | ||
} |
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,29 @@ | ||
variable "atlas_org_id" { | ||
description = "Atlas organization id" | ||
default = "" | ||
} | ||
variable "public_key" { | ||
description = "Public API key to authenticate to Atlas" | ||
} | ||
variable "private_key" { | ||
description = "Private API key to authenticate to Atlas" | ||
} | ||
variable "provider_name" { | ||
description = "Atlas cluster provider name" | ||
default = "AWS" | ||
} | ||
|
||
variable "provider_instance_size_name" { | ||
description = "Atlas cluster provider instance name" | ||
default = "M40" | ||
} | ||
|
||
variable "provider_volume_type" { | ||
description = "Atlas cluster provider storage volume name" | ||
default = "STANDARD" | ||
} | ||
|
||
variable "provider_disk_iops" { | ||
description = "Atlas cluster provider disk iops" | ||
default = 100 | ||
} |
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 @@ | ||
terraform { | ||
required_providers { | ||
mongodbatlas = { | ||
source = "mongodb/mongodbatlas" | ||
} | ||
} | ||
required_version = ">= 0.13" | ||
} |