-
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
fix: adjust root project_id
attribute in mongdbatlas_project_api_key
resource to optional
#1664
Conversation
_, roleOk := d.GetOk("role_names") | ||
if !roleOk { |
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.
legacy check, role_names
no longer exists at root level.
@@ -16,29 +16,32 @@ description: |- | |||
|
|||
## Example Usage | |||
|
|||
### Using org_id attribute to query |
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.
no changes in data source, just doc fixes I found
@@ -17,29 +17,25 @@ description: |- | |||
## Example Usage | |||
|
|||
```terraform | |||
resource "mongodbatlas_project_api_key" "test" { |
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.
no changes in data source, just doc fixes I found
} | ||
|
||
// creates api key using project id of first defined project assignment | ||
firstAssignment := projectAssignmentList[0] |
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.
should this new behaviour be documented? is it a breaking change? What happens with project_id
when it is actually defined? from this code it seems like it won't be used aynmore
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.
So this is more of an implementation detail: one project id is used for the creation of the api key, and then remaining projects assignments are assigned to the new api key. The previous implementation was essentially the same, only instead of taking the first element for the project assignment list it would grab the project which was defined in root project_id for the creation of the api key. From a users standpoint it is the same.
What happens with project_id when it is actually defined? from this code it seems like it won't be used anymore
This is correct, it is no longer used. From docs changes and deprecation warning users will be aware this attribute is no longer being used (https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1665/files#diff-31571e18c14ed5632e87c050342b195d9cbc5092b465b08abfb8b1dcf87d37bdL49)
917bfe0
to
af2ad94
Compare
…resource to optional
af2ad94
to
8dd67d8
Compare
|
failing tests are related to "MAX_GROUPS_PER_ORG_EXCEEDED" issue in testing org, verified migration and acceptance tests are passing well. |
Description
Link to any related issue(s): INTMDB-1296
Making root
project_id
attribute inmongdbatlas_project_api_key
optional enables users to unassign the root project from the created API Key without having to delete the resource all together. More details in the referenced ticket.Type of change:
Required Checklist:
Further comments