-
Notifications
You must be signed in to change notification settings - Fork 189
INTMDB-533: Feature Add: Programmatically Create Organizations #1176
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
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.
Few comments, happy to take another look when ready
|
||
`mongodbatlas_organization` provides a Organization resource. This allows organization to be created. | ||
|
||
~> **IMPORTANT NOTE:** Creating an organization with this resource creates initial public and private key values that will need to be used in a separate terraform module/blueprint to permit access to new organization. |
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.
Not sure what this means, can you rephrase/make more clear? If easier feel free to borrow language from Atlas Admin API docs - https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Organizations/operation/createOrganization
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.
He's saying that you can't start creating things with this new key pair in the same Terraform apply that creates the new organization. Just need to rephrase it to be a bit more clear.
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.
Still could use improvement but not blocking on it.
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.
thanks. updated directly in case you want to take another look @themantissa
Also @martinstibbe can you resolve the failing GitHub check |
@@ -0,0 +1,76 @@ | |||
# Example - A basic example to create and Orgnization with MongoDB Atlas and Terraform |
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.
I think we're missing a README.MD in the root of atlas-organization
that links together the two steps & explains the overall flow & why it's a 2-step process
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.
Also a question for the 2 steps - could we instead have made 2 local modules in the example and then called them from a root module main.tf
passing parameters between them as necessary? It would save the user needing to do two terraform apply
, but I may be missing something in the staging of the process here.
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 on these - we can't assume anyone will figure this out on their own.
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.
Yep was trying to keep them isolated so the do not try to use old API keys on new org in next apply needs work I agree
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.
Resolved for me, @colm-quinn leaving open as it's your point.
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 exciting to finally be this close to org creation! A few comments/questions/suggestions.
|
||
## Argument Reference | ||
|
||
* `name` - (Required) The name of the organization you want to create. (Cannot be changed via this Provider after creation.) |
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 might need to change, depending on the answer to my question in the resource code.
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.
Still need an answer on https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1176/files#r1213704086
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.
@martinstibbe i think we are missing isDeleted
here: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Organizations/operation/renameOrganization
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.
Added isDeleted
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.
Left several minor comments, thanks
export MONGODB_ATLAS_PRIVATE_KEY="xxxx" | ||
``` | ||
|
||
... or follow as in the `variables.tf` file and create **terraform.tfvars** file with all the variable values and make sure **not to commit it**. |
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.
to me, "follow as in" is not totally clear - does this mean follow variables.tf
as an example?
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.
corrected to say utiliize
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.
changed to utilize variables.tf
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
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 pending doc feedbacks from my comments earlier
Co-authored-by: Zuhair Ahmed <[email protected]>
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.
A few things that are "nice to have" but not must have. This one however: https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1176/files#r1213704086 I'd like to get an answer on before I approve. Thanks!!
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.
Amazing turn around time on the update improvement. LGTM!
return nil | ||
} | ||
|
||
func resourceMongoDBAtlasOrganizationUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { |
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.
Speeeeeeedy! Thanks all!
* fix: microsoft_teams_webhook_url keeps updating on every apply (#1148) * INTMDB-783: Point in Time Restore is not enabled when should_copy_oplogs is set to true, when copying backups to other regions (#1150) * Rebase v1.10.0 (#1156) * INTMDB-710: Serverless Instance wants to do an in-place update on every run (#1152) * INTMDB-694: Add PrivateEndpoint.srvShardOptimizedConnectionString to cluster (#1157) * INTMDB-780: analyzer argument in Atlas search index is required (issue #1132) (#1158) * INTMDB-809: upgrade atlas go-client to v0.26.0 (#1164) * INTMDB-809: upgrade atlas go-client * Update go.mod * remain doc updates * INTMDB-801: [Terraform] Create new TF Federated Database Instance resources and data sources (#1163) * INTMDB-408: Remove Deprecated Resources - cloud_provider resources, private_ip_mode, NEW_RELIC and FLOWDOCK in third_party_integration resource (#1159) * Remove deprecated resources * Deprecate additional related resource parameters * Add log message * Remove mongodbatlas_private_ip_mode * Add Full deprecation notice to Docs * more doc updates --------- Co-authored-by: Zuhair Ahmed <[email protected]> * INTMDB-466 - Added is_extended_storage_sizes_enabled (#1128) * Added is_extended_storage_sizes enabled * Fixed lint complaints * INTMDB-834: Address Follow Up comments in INTMDB-804 (#1181) * node_count docs update * INTMDB-804: [Terraform] Create new TF Data Lake Pipelines resource and data sources. (#1174) * INTMDB-805: [Terraform] Create new TF Data Lake Pipelines Run data sources only (not resource) (#1177) * INTMDB-803: [Terraform] Create a new Private Endpoint resource and data sources which supports Federated Database Instance and Online Archive (#1182) * INTMDB-806: Deprecate "mongodbatlas_data_lake" and "privatelink_endpoint_service_adl" (#1190) * Make aws field optional in federated_database_instance resource and upgrade aws provider (#1205) * INTMDB-835: Create resource mongodbatlas_cluster_outage_simulation (#1188) * Fix typos in docs for network peering resource imports (#1200) * Remove delete from create update (#1209) * INTMDB-781: [Terraform] Parameter Add: retainBackups in Cluster and Advanced_Cluster (#1210) * INTMDB-856: Add cloudProviderConfig to mongodbatlas_federated_database_instance (#1215) * INTMDB-655: PAK Resource Updates + Doc Cleanup + Deprecation Warnings (#1208) * Add project_assignment feature to permit assigning multiple projects to an API key * Add deprecation * lint * Add examples for project and org API key * Add additional multi project example * Update versions.tf * Add deprecation message create function to remove duplicated code * lint * Add new deprecation message * Bump terraform version * Update project_api_key.html.markdown * Update project.html.markdown * Update docs * Add validation of project_assignment parameter * Create README.md * Update README.md * Create PAK-upgrade-guide-1.10.0.html.markdown * Update PAK-upgrade-guide-1.10.0.html.markdown * Update project_api_key.html.markdown * Update website/docs/r/access_list_api_key.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update website/docs/d/access_list_api_key.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update examples/atlas-api-key/create-and-assign-pak-together/README.md Co-authored-by: zach-carr <[email protected]> * Update examples/atlas-api-key/create-api-key-assign-to-multiple-projects/README.md Co-authored-by: zach-carr <[email protected]> * Update examples/atlas-api-key/README.md Co-authored-by: zach-carr <[email protected]> * Update website/docs/r/project.html.markdown Co-authored-by: Zuhair Ahmed <[email protected]> * Update examples/atlas-api-key/create-and-assign-pak-seperately/README.md Co-authored-by: zach-carr <[email protected]> * Update examples/atlas-api-key/create-and-assign-pak-seperately/README.md Co-authored-by: Zuhair Ahmed <[email protected]> * Update examples/atlas-api-key/create-and-assign-pak-seperately/README.md Co-authored-by: zach-carr <[email protected]> * Add additional deprecation note * Update README.md * Bump up SDK to v0.29.0 * Update README.md More details to Readme explaining that all API keys are Organization Keys to help users --------- Co-authored-by: Zuhair Ahmed <[email protected]> Co-authored-by: Melissa Plunkett <[email protected]> Co-authored-by: zach-carr <[email protected]> * INTMDB-533: Feature Add: Programmatically Create Organizations (#1176) * Initial version * Acceptance testing issue for org creation * Add initial examples of org creation * skip tests for moment on organization resource * Add documentation * typo * terraform fmt * lint * go mod tidy * Documentation updates PR feedback * update TF version * Update variables.tf * Add additional Readme to show how to apply 2 step example * Update docs * Update examples/atlas-organization/Readme.md Co-authored-by: Zuhair Ahmed <[email protected]> * Update examples/atlas-organization/Readme.md * Update examples/atlas-organization/organization-step-1/Readme.md * Update examples/atlas-organization/organization-step-2/Readme.md Co-authored-by: Melissa Plunkett <[email protected]> * Update website/docs/r/organization.html.markdown * Update website/docs/d/organizations.html.markdown * Update go SDK add Org Update * Fix broken tests * Add isDeleted * Update go.sum --------- Co-authored-by: Zuhair Ahmed <[email protected]> Co-authored-by: Melissa Plunkett <[email protected]> * INTMDB-802: Create new TF Data Federation Query Limit resource and data sources (#1173) * INTMDB-802: Add data_source and resource for Federated Database Query Limit * INTMDB-802: update provider.go * INTMDB-802: Add AtlasDataFederation Query Limit resource * INTMDB-802: Add AtlasDataFederation Query Limit resource * Update data_source_mongodbatlas_federated_query_limit.go * Update resource_mongodbatlas_federated_query_limit.go * INTMDB-802: temp * INTMDB-802: Add example * INTMDB-802: Add example * INTMDB-802: minor * INTMDB-802: example fix * Acceptance tests * Acceptance tests * Fix docs * Update main.tf * Update mongodbatlas/resource_mongodbatlas_federated_query_limit.go Co-authored-by: Andrea Angiolillo <[email protected]> * Update mongodbatlas/resource_mongodbatlas_federated_query_limit.go Co-authored-by: Andrea Angiolillo <[email protected]> * Update mongodbatlas/data_source_mongodbatlas_federated_query_limit.go Co-authored-by: Andrea Angiolillo <[email protected]> * Update mongodbatlas/resource_mongodbatlas_federated_query_limit.go Co-authored-by: Andrea Angiolillo <[email protected]> * Update mongodbatlas/resource_mongodbatlas_federated_query_limit.go Co-authored-by: Andrea Angiolillo <[email protected]> * Update website/docs/d/federated_query_limit.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update website/docs/d/federated_query_limit.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update website/docs/r/federated_query_limit.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update website/docs/r/federated_query_limit.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update website/docs/r/federated_query_limit.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update website/docs/d/federated_query_limits.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update website/docs/r/federated_query_limit.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update federated_query_limit.html.markdown * Update federated_query_limit.html.markdown * Address PR comments * Address PR comments * Update website/docs/d/federated_query_limit.html.markdown Co-authored-by: Zuhair Ahmed <[email protected]> * Update website/docs/d/federated_query_limits.html.markdown Co-authored-by: Zuhair Ahmed <[email protected]> * Update examples/federated-database-query-limit/README.md Co-authored-by: Zuhair Ahmed <[email protected]> * Update examples/federated-database-query-limit/README.md Co-authored-by: Zuhair Ahmed <[email protected]> * Update examples/federated-database-query-limit/README.md Co-authored-by: Zuhair Ahmed <[email protected]> * Update federated_query_limit.html.markdown * Update federated_query_limits.html.markdown * Update README.md * Address PR comments * Address PR comments * Apply suggestions from code review Co-authored-by: zach-carr <[email protected]> * INTMDB-805: [Terraform] Create new TF Data Lake Pipelines Run data sources only (not resource) (#1177) * INTMDB-803: [Terraform] Create a new Private Endpoint resource and data sources which supports Federated Database Instance and Online Archive (#1182) * Fix AWS provider version and example * updated federated instance * Addressed Comments * Update mongodbatlas/data_source_mongodbatlas_federated_query_limits.go Co-authored-by: Andrea Angiolillo <[email protected]> * Update data_source_mongodbatlas_federated_query_limits.go --------- Co-authored-by: Andrea Angiolillo <[email protected]> Co-authored-by: Melissa Plunkett <[email protected]> Co-authored-by: Zuhair Ahmed <[email protected]> Co-authored-by: zach-carr <[email protected]> * Update .github_changelog_generator * Update CHANGELOG.md --------- Co-authored-by: maastha <[email protected]> Co-authored-by: Andrea Angiolillo <[email protected]> Co-authored-by: Zuhair Ahmed <[email protected]> Co-authored-by: Dosty Everts <[email protected]> Co-authored-by: Johanna Öjeling <[email protected]> Co-authored-by: Melissa Plunkett <[email protected]> Co-authored-by: zach-carr <[email protected]>
Description
Feature Add: Programmatically Create Organizations
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments