diff --git a/docs/data-sources/flex_cluster.md b/docs/data-sources/flex_cluster.md new file mode 100644 index 0000000000..277ae52c8f --- /dev/null +++ b/docs/data-sources/flex_cluster.md @@ -0,0 +1,83 @@ +# Data Source: mongodbatlas_flex_cluster + +`mongodbatlas_flex_cluster` describes a flex cluster. + +-> **NOTE**: Flex Clusters are currently in Preview. To use this feature, you must take the following actions: +1. Enable the `Atlas Uss Enabled` Preview Feature in your project (contact [MongoDB Support](https://www.mongodb.com/services/support)). +2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands. + +## Example Usages +```terraform +resource "mongodbatlas_flex_cluster" "flex_cluster" { + project_id = var.project_id + name = "clusterName" + provider_settings = { + backing_provider_name = "AWS" + region_name = "US_EAST_1" + } + termination_protection_enabled = true +} + +data "mongodbatlas_flex_cluster" "flex_cluster" { + project_id = var.project_id + name = mongodbatlas_flex_cluster.flex_cluster.name +} + +data "mongodbatlas_flex_clusters" "flex_cluster" { + project_id = var.project_id + name = mongodbatlas_flex_cluster.flex_cluster.name +} +``` + + +## Schema + +### Required + +- `name` (String) Human-readable label that identifies the flex cluster. +- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + +**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + +### Read-Only + +- `backup_settings` (Attributes) Flex backup configuration (see [below for nested schema](#nestedatt--backup_settings)) +- `cluster_type` (String) Flex cluster topology. +- `connection_strings` (Attributes) Collection of Uniform Resource Locators that point to the MongoDB database. (see [below for nested schema](#nestedatt--connection_strings)) +- `create_date` (String) Date and time when MongoDB Cloud created this instance. This parameter expresses its value in ISO 8601 format in UTC. +- `id` (String) Unique 24-hexadecimal digit string that identifies the instance. +- `mongo_db_version` (String) Version of MongoDB that the instance runs. +- `provider_settings` (Attributes) Group of cloud provider settings that configure the provisioned MongoDB flex cluster. (see [below for nested schema](#nestedatt--provider_settings)) +- `state_name` (String) Human-readable label that indicates the current operating condition of this instance. +- `tags` (Map of String) Map that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the instance. +- `termination_protection_enabled` (Boolean) Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. +- `version_release_system` (String) Method by which the cluster maintains the MongoDB versions. + + +### Nested Schema for `backup_settings` + +Read-Only: + +- `enabled` (Boolean) Flag that indicates whether backups are performed for this flex cluster. Backup uses [TODO](TODO) for flex clusters. + + + +### Nested Schema for `connection_strings` + +Read-Only: + +- `standard` (String) Public connection string that you can use to connect to this cluster. This connection string uses the mongodb:// protocol. +- `standard_srv` (String) Public connection string that you can use to connect to this flex cluster. This connection string uses the `mongodb+srv://` protocol. + + + +### Nested Schema for `provider_settings` + +Read-Only: + +- `backing_provider_name` (String) Cloud service provider on which MongoDB Cloud provisioned the flex cluster. +- `disk_size_gb` (Number) Storage capacity available to the flex cluster expressed in gigabytes. +- `provider_name` (String) Human-readable label that identifies the cloud service provider. +- `region_name` (String) Human-readable label that identifies the geographic location of your MongoDB flex cluster. The region you choose can affect network latency for clients accessing your databases. For a complete list of region names, see [AWS](https://docs.atlas.mongodb.com/reference/amazon-aws/#std-label-amazon-aws), [GCP](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/). + +For more information see: [MongoDB Atlas API - Flex Cluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Flex-Clusters/operation/getFlexCluster) Documentation. diff --git a/docs/data-sources/flex_clusters.md b/docs/data-sources/flex_clusters.md new file mode 100644 index 0000000000..3f4b92da39 --- /dev/null +++ b/docs/data-sources/flex_clusters.md @@ -0,0 +1,93 @@ +# Data Source: mongodbatlas_flex_clusters + +`mongodbatlas_flex_clusters` returns all flex clusters in a project. + +-> **NOTE**: Flex Clusters are currently in Preview. To use this feature, you must take the following actions: +1. Enable the `Atlas Uss Enabled` Preview Feature in your project (contact [MongoDB Support](https://www.mongodb.com/services/support)). +2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands. + +## Example Usages +```terraform +resource "mongodbatlas_flex_cluster" "flex_cluster" { + project_id = var.project_id + name = "clusterName" + provider_settings = { + backing_provider_name = "AWS" + region_name = "US_EAST_1" + } + termination_protection_enabled = true +} + +data "mongodbatlas_flex_cluster" "flex_cluster" { + project_id = var.project_id + name = mongodbatlas_flex_cluster.flex_cluster.name +} + +data "mongodbatlas_flex_clusters" "flex_cluster" { + project_id = var.project_id + name = mongodbatlas_flex_cluster.flex_cluster.name +} +``` + + +## Schema + +### Required + +- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + +**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + +### Read-Only + +- `results` (Attributes List) List of returned documents that MongoDB Cloud provides when completing this request. (see [below for nested schema](#nestedatt--results)) + + +### Nested Schema for `results` + +Read-Only: + +- `backup_settings` (Attributes) Flex backup configuration (see [below for nested schema](#nestedatt--results--backup_settings)) +- `cluster_type` (String) Flex cluster topology. +- `connection_strings` (Attributes) Collection of Uniform Resource Locators that point to the MongoDB database. (see [below for nested schema](#nestedatt--results--connection_strings)) +- `create_date` (String) Date and time when MongoDB Cloud created this instance. This parameter expresses its value in ISO 8601 format in UTC. +- `id` (String) Unique 24-hexadecimal digit string that identifies the instance. +- `mongo_db_version` (String) Version of MongoDB that the instance runs. +- `name` (String) Human-readable label that identifies the flex cluster. +- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + +**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. +- `provider_settings` (Attributes) Group of cloud provider settings that configure the provisioned MongoDB flex cluster. (see [below for nested schema](#nestedatt--results--provider_settings)) +- `state_name` (String) Human-readable label that indicates the current operating condition of this instance. +- `tags` (Map of String) Map that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the instance. +- `termination_protection_enabled` (Boolean) Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. +- `version_release_system` (String) Method by which the cluster maintains the MongoDB versions. + + +### Nested Schema for `results.backup_settings` + +Read-Only: + +- `enabled` (Boolean) Flag that indicates whether backups are performed for this flex cluster. Backup uses [TODO](TODO) for flex clusters. + + + +### Nested Schema for `results.connection_strings` + +Read-Only: + +- `standard` (String) Public connection string that you can use to connect to this cluster. This connection string uses the mongodb:// protocol. +- `standard_srv` (String) Public connection string that you can use to connect to this flex cluster. This connection string uses the `mongodb+srv://` protocol. + + + +### Nested Schema for `results.provider_settings` + +Read-Only: + +- `backing_provider_name` (String) Cloud service provider on which MongoDB Cloud provisioned the flex cluster. +- `disk_size_gb` (Number) Storage capacity available to the flex cluster expressed in gigabytes. +- `provider_name` (String) Human-readable label that identifies the cloud service provider. +- `region_name` (String) Human-readable label that identifies the geographic location of your MongoDB flex cluster. The region you choose can affect network latency for clients accessing your databases. For a complete list of region names, see [AWS](https://docs.atlas.mongodb.com/reference/amazon-aws/#std-label-amazon-aws), [GCP](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/). + +For more information see: [MongoDB Atlas API - Stream Processor](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/listFlexClusters) Documentation. diff --git a/docs/resources/flex_cluster.md b/docs/resources/flex_cluster.md index 13e32d7715..0a0d45d144 100644 --- a/docs/resources/flex_cluster.md +++ b/docs/resources/flex_cluster.md @@ -17,7 +17,17 @@ resource "mongodbatlas_flex_cluster" "flex_cluster" { region_name = "US_EAST_1" } termination_protection_enabled = true -} # TODO: add plural and singular data source example +} + +data "mongodbatlas_flex_cluster" "flex_cluster" { + project_id = var.project_id + name = mongodbatlas_flex_cluster.flex_cluster.name +} + +data "mongodbatlas_flex_clusters" "flex_cluster" { + project_id = var.project_id + name = mongodbatlas_flex_cluster.flex_cluster.name +} ``` @@ -78,7 +88,7 @@ Read-Only: # Import Flex Cluster resource can be imported using the Project ID and Flex Cluster name, in the format `PROJECT_ID-FLEX_CLUSTER_NAME`, e.g. ``` -$ terraform import mongodbatlas_flex_cluster.test 6117ac2fe2a3d04ed27a987v-yourFlexClsuterName +$ terraform import mongodbatlas_flex_cluster.test 6117ac2fe2a3d04ed27a987v-yourFlexClusterName ``` For more information see: [MongoDB Atlas API - Flex Cluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Flex-Clusters/operation/createFlexcluster) Documentation. diff --git a/examples/mongodbatlas_flex_cluster/README.md b/examples/mongodbatlas_flex_cluster/README.md index 09ad2147c1..e078c43b81 100644 --- a/examples/mongodbatlas_flex_cluster/README.md +++ b/examples/mongodbatlas_flex_cluster/README.md @@ -1,7 +1,7 @@ # MongoDB Atlas Provider -- Atlas Flex Cluster This example creates one flex cluster in a project. -**NOTE**: Flex Clusters are currently in Private Preview. To use this feature, you must take the following actions: +**NOTE**: Flex Clusters are currently in Preview. To use this feature, you must take the following actions: 1. Enable the `Atlas USS` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)). 2. Enable the [Preview Features](../../README.md#preview-features) when running `terraform` commands.