Skip to content

Commit

Permalink
doc: documentation errors in cloud provider access (#1615)
Browse files Browse the repository at this point in the history
* doc: Fix typos and syntax errors

* doc: Add details about how this resource can be used

* Update website/docs/r/cloud_provider_access.markdown

Co-authored-by: John Williams <[email protected]>

* doc: Add references to documentation in Github

* Update website/docs/r/cloud_provider_access.markdown

Co-authored-by: Agustin Bettati <[email protected]>

---------

Co-authored-by: Steven Hirschorn <[email protected]>
Co-authored-by: John Williams <[email protected]>
Co-authored-by: Agustin Bettati <[email protected]>
  • Loading branch information
4 people authored Nov 15, 2023
1 parent 8166c7f commit 6437868
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions website/docs/r/cloud_provider_access.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ The Terraform MongoDB Atlas Provider offers two either-or/mutually exclusive pat
* A Two Resource path: consisting of `mongodbatlas_cloud_provider_access_setup` and `mongodbatlas_cloud_provider_access_authorization`. The first resource, `mongodbatlas_cloud_provider_access_setup`, only generates
the initial configuration (create, delete operations). The second resource, `mongodbatlas_cloud_provider_access_authorization`, helps to perform the authorization using the role_id of the first resource. This path is helpful in a multi-provider Terraform file, and allows for a single and decoupled apply. See example of this Two Resource path option with AWS Cloud [here](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples/atlas-cloud-provider-access/aws) and AZURE Cloud [here](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples/atlas-cloud-provider-access/azure).

* A Single Resource path: using the `mongodbatlas_cloud_provider_access` that at provision time sets up all the required configuration for a given provider, then with a subsequent update it can perform the authorize of the role. Note this path requires two `terraform apply` commands, once for setup and once for auth. This resource supports only `AWS`.
* A Two Resource path: consisting of `mongodbatlas_cloud_provider_access_setup` and `mongodbatlas_cloud_provider_access_authorization`. The first resource, `mongodbatlas_cloud_provider_access_setup`, only generates
the initial configuration (create, delete operations). The second resource, `mongodbatlas_cloud_provider_access_authorization`, helps to perform the authorization using the role_id of the first resource. This path is helpful in a multi-provider Terraform file, and allows for a single and decoupled apply. See example of this Two Resource path option with AWS Cloud [here](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples/atlas-cloud-provider-access/aws) and AZURE Cloud [here](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples/atlas-cloud-provider-access/azure).

* A Single Resource path: using the `mongodbatlas_cloud_provider_access` that at provision time sets up all the required configuration for a given provider, then with a subsequent update it can perform the authorize of the role. Note this path requires two `terraform apply` commands, once for setup and once for auth. This resource supports only `AWS`.
**WARNING:** The resource `mongodbatlas_cloud_provider_access` is deprecated and will be removed in version v1.14.0, use the Two Resource path instead.

Expand Down Expand Up @@ -77,6 +73,8 @@ resource "mongodbatlas_cloud_provider_access_setup" "test_role" {
* `last_updated_date` - Date and time when this Azure Service Principal was last updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
* `role_id` - Unique ID of this role.

-> **NOTE:** For more details on how attributes are used to enable access to cloud provider accounts see [AWS example](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples/atlas-cloud-provider-access/aws) and [Azure example](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples/atlas-cloud-provider-access/azure).

## Import: mongodbatlas_cloud_provider_access_setup
For consistency is has the same format as the regular mongodbatlas_cloud_provider_access resource
can be imported using project ID and the provider name and mongodbatlas role id, in the format
Expand All @@ -86,7 +84,7 @@ can be imported using project ID and the provider name and mongodbatlas role id,
$ terraform import mongodbatlas_cloud_provider_access_setup.my_role 1112222b3bf99403840e8934-AWS-5fc17d476f7a33224f5b224e
```

## mongodbatlas_cloud_provider_authorization
## mongodbatlas_cloud_provider_access_authorization

This is the second resource in the two-resource path as described above.
`mongodbatlas_cloud_provider_access_authorization` Allows you to authorize an AWS or AZURE IAM roles in Atlas.
Expand All @@ -104,8 +102,8 @@ resource "mongodbatlas_cloud_provider_access_authorization" "auth_role" {
project_id = mongodbatlas_cloud_provider_access_setup.setup_only.project_id
role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id
aws_config {
atlas_aws_account_arn = "arn:aws:iam::772401394250:role/test-user-role"
aws {
iam_assumed_role_arn = "arn:aws:iam::772401394250:role/test-user-role"
}
}
Expand Down

0 comments on commit 6437868

Please sign in to comment.