Skip to content

Commit

Permalink
generate data source documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cveticm committed Nov 5, 2024
1 parent 1cbeec8 commit 075cb1c
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 3 deletions.
83 changes: 83 additions & 0 deletions docs/data-sources/flex_cluster.md
Original file line number Diff line number Diff line change
@@ -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 generated by tfplugindocs -->
## 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.

<a id="nestedatt--backup_settings"></a>
### 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.


<a id="nestedatt--connection_strings"></a>
### 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.


<a id="nestedatt--provider_settings"></a>
### 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.
93 changes: 93 additions & 0 deletions docs/data-sources/flex_clusters.md
Original file line number Diff line number Diff line change
@@ -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 generated by tfplugindocs -->
## 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))

<a id="nestedatt--results"></a>
### 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.

<a id="nestedatt--results--backup_settings"></a>
### 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.


<a id="nestedatt--results--connection_strings"></a>
### 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.


<a id="nestedatt--results--provider_settings"></a>
### 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.
14 changes: 12 additions & 2 deletions docs/resources/flex_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```

<!-- schema generated by tfplugindocs -->
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion examples/mongodbatlas_flex_cluster/README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down

0 comments on commit 075cb1c

Please sign in to comment.