-
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: Avoids import error for database_user when both username and auth database contain hyphens #2928
Conversation
APIx bot: a message has been sent to Docs Slack channel |
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!
func ImportSplit3(importRaw string) (ok bool, part1, part2, part3 string) { | ||
parts := strings.Split(importRaw, "/") | ||
if len(parts) != 3 { | ||
return false, "", "", "" | ||
} | ||
return true, parts[0], parts[1], parts[2] | ||
} | ||
|
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.
[Curious] Is the use of /
as a separator for import applied to all the resources? Besides this question, I think you should add additional documentation to highlight this change in the TF doc
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.
+1 would update the resource documentation import section.
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.
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.
nice. Left a small comment on the import doc but this is good for me.
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.
This decision does indeed bring a good conversation to have if it should be extended to all resources
|
||
``` | ||
$ terraform import mongodbatlas_database_user.my_user 1112222b3bf99403840e8934-my_user-admin | ||
terraform import mongodbatlas_database_user.my_user 1112222b3bf99403840e8934-my_user-admin # (1) | ||
terraform import mongodbatlas_database_user.my_user 1112222b3bf99403840e8934/my-username-dash/my-db-name # (2) |
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 we include here when user needs to use one format vs. the other?
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.
Good point to explain why and when
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.
Updated in caef9ba
Description
id
by/
. See details on why/
in issueLink to any related issue(s): CLOUDP-289266 #2876
Type of change:
Required Checklist:
Further comments