From e12584c0fa07afecbec925c70e82a60181471d06 Mon Sep 17 00:00:00 2001 From: martinstibbe <33664051+martinstibbe@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:55:23 -0600 Subject: [PATCH] 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](https://github.com/golangci/golangci-lint-action/compare/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] Signed-off-by: dependabot[bot] 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 * Update examples/atlas-cluster/nvme-upgrade/README.md Co-authored-by: Zuhair Ahmed * Update examples/atlas-cluster/nvme-upgrade/README.md Co-authored-by: Zuhair Ahmed --------- Signed-off-by: dependabot[bot] Co-authored-by: Zuhair Ahmed Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/atlas-cluster/nvme-upgrade/README.md | 40 +++++++++++++++++++ examples/atlas-cluster/nvme-upgrade/main.tf | 21 ++++++++++ .../atlas-cluster/nvme-upgrade/variables.tf | 29 ++++++++++++++ .../atlas-cluster/nvme-upgrade/versions.tf | 8 ++++ 4 files changed, 98 insertions(+) create mode 100644 examples/atlas-cluster/nvme-upgrade/README.md create mode 100644 examples/atlas-cluster/nvme-upgrade/main.tf create mode 100644 examples/atlas-cluster/nvme-upgrade/variables.tf create mode 100644 examples/atlas-cluster/nvme-upgrade/versions.tf diff --git a/examples/atlas-cluster/nvme-upgrade/README.md b/examples/atlas-cluster/nvme-upgrade/README.md new file mode 100644 index 0000000000..6c6ab3878e --- /dev/null +++ b/examples/atlas-cluster/nvme-upgrade/README.md @@ -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 = +private_key = +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 = +private_key = +provider_name = "AWS" +provider_instance_size_name = "M40_NVME" +provider_volume_type = "PROVISIONED" +provider_disk_iops = 135125 +``` \ No newline at end of file diff --git a/examples/atlas-cluster/nvme-upgrade/main.tf b/examples/atlas-cluster/nvme-upgrade/main.tf new file mode 100644 index 0000000000..3168b2179b --- /dev/null +++ b/examples/atlas-cluster/nvme-upgrade/main.tf @@ -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 +} diff --git a/examples/atlas-cluster/nvme-upgrade/variables.tf b/examples/atlas-cluster/nvme-upgrade/variables.tf new file mode 100644 index 0000000000..0ceda66e6c --- /dev/null +++ b/examples/atlas-cluster/nvme-upgrade/variables.tf @@ -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 +} \ No newline at end of file diff --git a/examples/atlas-cluster/nvme-upgrade/versions.tf b/examples/atlas-cluster/nvme-upgrade/versions.tf new file mode 100644 index 0000000000..92fca3b63d --- /dev/null +++ b/examples/atlas-cluster/nvme-upgrade/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + mongodbatlas = { + source = "mongodb/mongodbatlas" + } + } + required_version = ">= 0.13" +} \ No newline at end of file