-
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
feat: Adds atlas Organization New Parameters Support #1835
Conversation
…un tests" This reverts commit 404512e.
…b/terraform-provider-mongodbatlas into CLOUDP-219771-update-sdk
if err != nil { | ||
if _, _, err := conn.OrganizationsApi.DeleteOrganization(ctx, orgID).Execute(); err != nil { | ||
d.SetId("") | ||
return diag.FromErr(fmt.Errorf("an error occurred when updating Organization settings. Unable to delete organization, there may be dangling resources: %s", err)) |
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.
is it possible here to return both errors?
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
|
||
func isAPIKeyOrgOwner(roles []string) bool { | ||
for _, role := range roles { | ||
if role == "ORG_OWNER" { |
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 have ORG_OWNER as const?
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
}, | ||
} | ||
} | ||
|
||
func resourceMongoDBAtlasOrganizationCreate(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { | ||
if !isAPIKeyOrgOwner(conversion.ExpandStringList(d.Get("role_names").(*schema.Set).List())) { | ||
return diag.FromErr(fmt.Errorf("`role_names` for new API Key must have the ORG_OWNER role to use this resource")) |
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.
nit: you could return the err from the method
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
Co-authored-by: Leo Antoli <[email protected]>
…rm-provider-mongodbatlas into CLOUDP-219771-new-org-params
} | ||
|
||
func TestAccConfigRSOrganization_BasicAccess(t *testing.T) { | ||
acc.SkipTestForCI(t) |
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.
is it hard to run it in CI / GH?
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.
sorry this was missed, this requires setting a up a paying organization in cloud-dev that new organizations can be linked to, I couldn't get it to work with my personal organization in cloud-dev (even though I have billing enabled) so requires looking into setting up payments correctly
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
Description
Link to any related issue(s): https://jira.mongodb.org/browse/CLOUDP-219771
Type of change:
Required Checklist:
Further comments