Skip to content

Commit e12584c

Browse files
martinstibbeZuhairahmeddependabot[bot]
authored
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>
1 parent 2e6bcd1 commit e12584c

File tree

4 files changed

+98
-0
lines changed

4 files changed

+98
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# MongoDB Atlas Provider -- Cluster NVME (Non-Volatile Memory Express) Upgrade
2+
This example creates a project and cluster. It is intended to show how to upgrade from Standard, to PROVISIONED storage tier.
3+
4+
Variables Required:
5+
- `atlas_org_id`: ID of the Atlas organization
6+
- `public_key`: Atlas public key
7+
- `private_key`: Atlas private key
8+
- `provider_name`: Name of provider to use for cluster (TENANT, AWS, GCP)
9+
- `backing_provider_name`: If provider_name is tenant, the backing provider (AWS, GCP)
10+
- `provider_instance_size_name`: Size of the cluster (Shared: M0, M2, M5, Dedicated: M10+.)
11+
- `provider_volume_type`: Provider storage type STANDARD vs PROVISIONED (NVME)
12+
- `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/)
13+
* You do not need to configure IOPS for a STANDARD disk configuration but only for a PROVISIONED configuration.
14+
15+
For this example, first we'll start out on the standard tier, then upgrade to a NVME storage tier.
16+
17+
18+
Utilize the following to execute a working example, replacing the org id, public and private key with your values:
19+
20+
Apply with the following `terraform.tfvars` to first create a shared tier cluster:
21+
```
22+
atlas_org_id = "627a9687f7f7f7f774de306f14"
23+
public_key = <REDACTED>
24+
private_key = <REDACTED>
25+
provider_name = "AWS"
26+
provider_instance_size_name = "M40"
27+
provider_volume_type = "STANDARD"
28+
provider_disk_iops = 3000
29+
```
30+
31+
Apply with the following `terraform.tfvars` to upgrade the standard storage tier cluster you just created to provisioned storage NVME tier:
32+
```
33+
atlas_org_id = "627a9687f7f7f7f774de306f14"
34+
public_key = <REDACTED>
35+
private_key = <REDACTED>
36+
provider_name = "AWS"
37+
provider_instance_size_name = "M40_NVME"
38+
provider_volume_type = "PROVISIONED"
39+
provider_disk_iops = 135125
40+
```
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
provider "mongodbatlas" {
2+
public_key = var.public_key
3+
private_key = var.private_key
4+
}
5+
6+
resource "mongodbatlas_cluster" "cluster" {
7+
project_id = mongodbatlas_project.project.id
8+
name = "NVMEToUpgrade"
9+
cluster_type = "REPLICASET"
10+
provider_name = var.provider_name
11+
provider_region_name = "US_EAST_1"
12+
provider_instance_size_name = var.provider_instance_size_name
13+
provider_volume_type = var.provider_volume_type
14+
provider_disk_iops = var.provider_disk_iops
15+
cloud_backup = true
16+
}
17+
18+
resource "mongodbatlas_project" "project" {
19+
name = "NVMEUpgradeTest"
20+
org_id = var.atlas_org_id
21+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
variable "atlas_org_id" {
2+
description = "Atlas organization id"
3+
default = ""
4+
}
5+
variable "public_key" {
6+
description = "Public API key to authenticate to Atlas"
7+
}
8+
variable "private_key" {
9+
description = "Private API key to authenticate to Atlas"
10+
}
11+
variable "provider_name" {
12+
description = "Atlas cluster provider name"
13+
default = "AWS"
14+
}
15+
16+
variable "provider_instance_size_name" {
17+
description = "Atlas cluster provider instance name"
18+
default = "M40"
19+
}
20+
21+
variable "provider_volume_type" {
22+
description = "Atlas cluster provider storage volume name"
23+
default = "STANDARD"
24+
}
25+
26+
variable "provider_disk_iops" {
27+
description = "Atlas cluster provider disk iops"
28+
default = 100
29+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
terraform {
2+
required_providers {
3+
mongodbatlas = {
4+
source = "mongodb/mongodbatlas"
5+
}
6+
}
7+
required_version = ">= 0.13"
8+
}

0 commit comments

Comments
 (0)