|
| 1 | +--- |
| 2 | +layout: "mongodbatlas" |
| 3 | +page_title: "MongoDB Atlas Provider 0.9.1: Upgrade and Information Guide" |
| 4 | +sidebar_current: "docs-mongodbatlas-guides-091-upgrade-guide" |
| 5 | +description: |- |
| 6 | + MongoDB Atlas Provider 0.9.1: Upgrade and Information Guide |
| 7 | +--- |
| 8 | + |
| 9 | +# MongoDB Atlas Provider v0.9.1: Upgrade and Information Guide |
| 10 | + |
| 11 | +## Migration to Cloud Provider Access Setup |
| 12 | + |
| 13 | +To migrate from `mongodbatlas_cloud_provider_access` to `mongodbatlas_cloud_provider_access_setup` and `mongodbatlas_cloud_provider_access_authorization` |
| 14 | +perform the following steps |
| 15 | + |
| 16 | +1. Add the new `mongodbatlas_cloud_provider_access_setup` to your configuration file |
| 17 | + |
| 18 | +```hcl |
| 19 | +resource "mongodbatlas_cloud_provider_access_setup" "unique" { |
| 20 | + project_id = "<PROJECT-ID>" |
| 21 | + provider_name = "AWS" |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +2. Perform an import from your existing `mongodbatlas_cloud_provider_access` to `mongodbatlas_cloud_provider_access_setup` |
| 26 | +**NOTE:** if the import step is missing it will generate a new resource with a different ID |
| 27 | + |
| 28 | +```bash |
| 29 | + terraform import mongodbatlas_cloud_provider_access_setup.unique <project_id>-AWS-<role-id> |
| 30 | +``` |
| 31 | + |
| 32 | +3. Add the mongodbatlas_cloud_provider_access_authorization to the configuration file |
| 33 | + |
| 34 | +```hcl |
| 35 | +resource "mongodbatlas_cloud_provider_access_authorization" "auth" { |
| 36 | +
|
| 37 | + project_id = mongodbatlas_cloud_provider_access_setup.unique.project_id |
| 38 | + role_id = mongodbatlas_cloud_provider_access_setup.unique.role_id |
| 39 | +
|
| 40 | + aws = { |
| 41 | + iam_assumed_role_arn = "arn:aws:iam::772401394250:role/test-user-role" |
| 42 | + } |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +4. Execute a terraform plan, apply |
| 47 | + |
| 48 | +``` |
| 49 | + terraform plan |
| 50 | + terraform apply |
| 51 | +``` |
| 52 | + |
| 53 | +5. Remove your existing `mongodbatlas_cloud_provider_access` resource from terraform state |
| 54 | +**NOTE** before doing any terraform state change please do a backup |
| 55 | + |
| 56 | +```bash |
| 57 | + terraform state rm mongodbatlas_cloud_provider_access.test_role |
| 58 | +``` |
| 59 | + |
| 60 | +6. Remove the resource from the config |
| 61 | +7. Do a terraform plan (no changes detected) |
| 62 | + |
| 63 | +```bash |
| 64 | +terraform plan |
| 65 | + |
| 66 | +(...) |
| 67 | + |
| 68 | +No changes. Infrastructure is up-to-date. |
| 69 | + |
| 70 | +This means that Terraform did not detect any differences between your |
| 71 | +configuration and real physical resources that exist. As a result, no |
| 72 | +actions need to be performed. |
| 73 | +``` |
| 74 | + |
| 75 | +### Helpful Links |
| 76 | + |
| 77 | +* [Report bugs](https://github.com/mongodb/terraform-provider-mongodbatlas/issues) |
| 78 | + |
| 79 | +* [Request Features](https://feedback.mongodb.com/forums/924145-atlas?category_id=370723) |
| 80 | + |
| 81 | +* [Contact Support](https://docs.atlas.mongodb.com/support/) covered by MongoDB Atlas support plans, Developer and above. |
0 commit comments