-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INTMDB-183: Migrate to TF SDK 2 #489
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few docs edits, otherwise looks good. I'll create a ticket to update search and backup after they are merged. Just a note for the future - let's break these huge PRs up. For example this could have been a PR for the examples, a PR for docs, and a PR for the work (which we could maybe break up?) Will just help with review speed and accuracy.
|
||
``` | ||
|
||
Actual usage: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace "Actual usage" with "New usage" for all please.
@@ -79,6 +79,155 @@ so no changes are needed. | |||
**NOTE** Doc links for [mongodbatlas_privatelink_endpoint](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/privatelink_endpoint) | |||
**NOTE** Doc links for [mongodbatlas_privatelink_endpoint_service](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/privatelink_endpoint_service) | |||
|
|||
## Migration to Terraform SDK v2 | |||
|
|||
Because of migration to terraform sdk v2, in various resources and datasource(s) are not supported using TypeMap as object, instead it should use TypeSet or TypeList with MaxItems:1, here the list of resources affected by migration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a rewrite to make a bit more clear, please replace this with:
Due to the migration to Terraform SDK v2 various resources and datasource(s) have been impacted and will require a change within your configuration. These resources and datasources used the now unsupported TypeMap object. In SDK v2 these must be TypeSet or TypeList with MaxItems set to 1. The following is the list of resources and datasources impacted by the migration.
}, | ||
}, | ||
"aws_config": { | ||
Type: schema.TypeList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Question] For my own understanding and learning. Why use TypeList with maxlen 1
instead of TypeStr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because TypeList with MaxItems 1 ideally it's a object from the API, and TypeSet is an unordered list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I miss typed it. I meant why not use TypeString
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:O, I misread it then haha, well, because aws_config
is a object with two fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, if test pass.
This PR was too big to review for me. I'm afraid that I might have missed something.
…cause it's bad practice for make test and not supported in sdk v2
… issues related to state
…ce it can take a while usually depending of the case
Description
make test
, so the fix was adding another attribute and deprecate the old attribute, and for the new attributes was changed to TypeList with MaxItem 1, resources/datasources affected arealert_configuration
,cloud_provider_snapshot_restore_job
,mongodbatlas_encryption_at_rest
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments