Skip to content

Commit

Permalink
adjust documentation, add dataProcessRegion in basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinBettati committed Apr 30, 2024
1 parent 5e563b6 commit 8dfd6f4
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,80 +409,85 @@ resource "mongodbatlas_project" "test" {
}
resource "mongodbatlas_federated_database_instance" "test" {
project_id = mongodbatlas_project.test.id
name = %[1]q
project_id = mongodbatlas_project.test.id
name = %[1]q
storage_databases {
name = "VirtualDatabase0"
collections {
data_process_region {
cloud_provider = "AWS"
region = "OREGON_USA"
}
storage_databases {
name = "VirtualDatabase0"
collections {
name = "VirtualCollection0"
data_sources {
collection = "listingsAndReviews"
database = "sample_airbnb"
store_name = "ClusterTest"
}
}
}
storage_stores {
name = "ClusterTest"
cluster_name = "ClusterTest"
project_id = mongodbatlas_project.test.id
provider = "atlas"
read_preference {
mode = "secondary"
tag_sets {
tags {
name = "environment"
value = "development"
}
tags {
name = "application"
value = "app"
collection = "listingsAndReviews"
database = "sample_airbnb"
store_name = "ClusterTest"
}
}
tag_sets {
tags {
name = "environment1"
value = "development1"
}
storage_stores {
name = "ClusterTest"
cluster_name = "ClusterTest"
project_id = mongodbatlas_project.test.id
provider = "atlas"
read_preference {
mode = "secondary"
tag_sets {
tags {
name = "environment"
value = "development"
}
tags {
name = "application"
value = "app"
}
}
tags {
name = "application1"
value = "app-1"
tag_sets {
tags {
name = "environment1"
value = "development1"
}
tags {
name = "application1"
value = "app-1"
}
}
}
}
}
}
storage_stores {
name = "dataStore0"
cluster_name = "ClusterTest"
project_id = mongodbatlas_project.test.id
provider = "atlas"
read_preference {
mode = "secondary"
tag_sets {
tags {
name = "environment"
value = "development"
}
tags {
name = "application"
value = "app"
}
}
tag_sets {
tags {
name = "environment1"
value = "development1"
storage_stores {
name = "dataStore0"
cluster_name = "ClusterTest"
project_id = mongodbatlas_project.test.id
provider = "atlas"
read_preference {
mode = "secondary"
tag_sets {
tags {
name = "environment"
value = "development"
}
tags {
name = "application"
value = "app"
}
}
tags {
name = "application1"
value = "app-1"
tag_sets {
tags {
name = "environment1"
value = "development1"
}
tags {
name = "application1"
value = "app-1"
}
}
}
}
}
}
}
`, federatedInstanceName, projectName, orgID)
}
Expand All @@ -499,6 +504,11 @@ resource "mongodbatlas_federated_database_instance" "test" {
project_id = mongodbatlas_project.test.id
name = %[1]q
data_process_region {
cloud_provider = "AWS"
region = "OREGON_USA"
}
storage_databases {
name = "VirtualDatabase0"
collections {
Expand Down
27 changes: 10 additions & 17 deletions website/docs/r/federated_database_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ resource "mongodbatlas_federated_database_instance" "test" {
cloud_provider = "AWS"
region = "OREGON_USA"
}
storage_stores {
name = "NAME"
cluster_name = "CLUSTER NAME"
project_id = "PROJECT ID"
provider = "atlas"
}
}
```

Expand All @@ -124,15 +117,6 @@ resource "mongodbatlas_federated_database_instance" "test" {
* `data_process_region` - (Optional) The cloud provider region to which the Federated Instance routes client connections for data processing.
* `data_process_region.cloud_provider` - (Required) Name of the cloud service provider. Atlas Federated Database only supports AWS.
* `data_process_region.region` - (Required) Name of the region to which the Federanted Instnace routes client connections for data processing. See the [documention](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Federation/operation/createFederatedDatabase) for the available region.
## Attributes Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The Terraform's unique identifier used internally for state management.
* `hostnames` - The list of hostnames assigned to the Federated Database Instance. Each string in the array is a hostname assigned to the Federated Database Instance.
* `state` - Current state of the Federated Database Instance:
* `ACTIVE` - The Federated Database Instance is active and verified. You can query the data stores associated with the Federated Database Instance.
* `DELETED` - The Federated Database Instance was deleted.
* `storage_databases` - Configuration details for mapping each data store to queryable databases and collections. For complete documentation on this object and its nested fields, see [databases](https://docs.mongodb.com/datalake/reference/format/data-lake-configuration#std-label-datalake-databases-reference). An empty object indicates that the Federated Database Instance has no mapping configuration for any data store.
* `storage_databases.#.name` - Name of the database to which the Federated Database Instance maps the data contained in the data store.
* `storage_databases.#.collections` - Array of objects where each object represents a collection and data sources that map to a [stores](https://docs.mongodb.com/datalake/reference/format/data-lake-configuration#mongodb-datalakeconf-datalakeconf.stores) data store.
Expand Down Expand Up @@ -175,6 +159,16 @@ In addition to all arguments above, the following attributes are exported:
* `storage_stores.#.read_preference.tags` - List of all tags within a tag set
* `storage_stores.#.read_preference.tags.name` - Human-readable label of the tag.
* `storage_stores.#.read_preference.tags.value` - Value of the tag.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The Terraform's unique identifier used internally for state management.
* `hostnames` - The list of hostnames assigned to the Federated Database Instance. Each string in the array is a hostname assigned to the Federated Database Instance.
* `state` - Current state of the Federated Database Instance:
* `ACTIVE` - The Federated Database Instance is active and verified. You can query the data stores associated with the Federated Database Instance.
* `DELETED` - The Federated Database Instance was deleted.
* `cloud_provider_config.aws` - Name of the cloud service that hosts the data lake's data stores.
* `iam_assumed_role_arn` - Amazon Resource Name (ARN) of the IAM Role that the Federated Database Instance assumes when accessing S3 Bucket data stores. The IAM Role must support the following actions against each S3 bucket:
* `s3:GetObject`
Expand All @@ -184,7 +178,6 @@ In addition to all arguments above, the following attributes are exported:
For more information on S3 actions, see [Actions, Resources, and Condition Keys for Amazon S3](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazons3.html).
* `iam_user_arn` - Amazon Resource Name (ARN) of the user that the Federated Database Instance assumes when accessing S3 Bucket data stores.
* `external_id` - Unique identifier associated with the IAM Role that the Federated Database Instance assumes when accessing the data stores.
* `role_id` - Unique identifier of the role that the data lake can use to access the data stores.



Expand Down

0 comments on commit 8dfd6f4

Please sign in to comment.