Skip to content
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

Allow skipping export of Organizations #427

Closed
nathanKramer opened this issue Mar 3, 2022 · 7 comments
Closed

Allow skipping export of Organizations #427

nathanKramer opened this issue Mar 3, 2022 · 7 comments

Comments

@nathanKramer
Copy link

nathanKramer commented Mar 3, 2022

Describe the problem you'd like to have solved

Hi, I've recently updated the CLI to version 7, to allow exporting actions.

However, I'm having an issue where our tenant contains thousands of orgs.

The CLI now wants to export them along with their connections, which can't be done in a timely manner, and is not desired for our use-case.

My preference is to treat these Orgs as data, rather than as config that should be exported.
I'm wondering if there is any support for this.
(or if there are any suggestions for ergonomic work-arounds)

I can't find any evidence that this is supported, but I thought I would ask.

It's not clear to me whether it is safe to try to delete organizations from the resulting export, and then deploy, or if this would delete organizations. (This issue seems relevant: #387)

Describe the ideal solution

Some way to exclude organizations from the export.

e.g, an environment variable, or some kind of manifest that outlines the desired export)

Attempted work arounds

I tried dropping the read:organizations scope, but the export throws:

2022-03-03T03:21:01.811Z - info: Retrieving organizations data from Auth0
2022-03-03T03:21:02.012Z - error: Problem running command export during stage load when processing type organizations
2022-03-03T03:21:02.012Z - error: Insufficient scope, expected any of: read:organizations
2022-03-03T03:21:02.013Z - debug: Forbidden: Insufficient scope, expected any of: read:organizations
@willvedd
Copy link
Contributor

willvedd commented Mar 8, 2022

Thanks for raising this. I think this is a duplicate of #387 which I have just merged a relevant fix for. In short, excluding resources from the configuration-as-code files should exclude them from being handled by the deploy CLI. That is, as long as the data doesn't explicitly define those resources as an empty set and rather not defined at all, they should be skipped. I think what you've found is that organizations paired with the YAML format doesn't follow this pattern and that will be fixed in an upcoming release (#434).

But something to remember is that as long as AUTH0_ALLOW_DELETE isn't set to true, you're never at risk of deleting any of your organizations. So as far as workarounds go, until 7.5.0 is released, it's ok to remove organization configuration and have AUTH0_ALLOW_DELETE:false in your config, you'll just see some warnings.

@willvedd
Copy link
Contributor

willvedd commented Mar 9, 2022

Good news, 7.5.0 has been released to address this. I encourage you to update and test. I'm closing this for now but please open a new ticket if you're still experiencing this issue.

@willvedd willvedd closed this as completed Mar 9, 2022
@nathanKramer
Copy link
Author

@willvedd to be clear - a big part of the issue for us is that the export (as opposed to the deploy) takes an extremely long time.

I don't think that has been addressed. Is it worth keeping this issue open?

@willvedd
Copy link
Contributor

willvedd commented Mar 9, 2022

Ah ok, my mistake! Resource exclusion on the export side is a commonly requested feature that's on our roadmap. We can certainly keep this open until it gets addressed more formally.

@willvedd
Copy link
Contributor

@nathanKramer I've raised a #451 that may solve this issue. It would be great to receive your feedback since your use case would be enhanced by excluding all organizations.

@willvedd
Copy link
Contributor

willvedd commented Apr 8, 2022

As proposed in the resource exclusion RFC, this has been added in the 7.7.0 release. You can bi-directionally exclude all organizations by leveraging the AUTH0_EXCLUDED configuration property. Example:

{ 
 "AUTH0_DOMAIN": "<YOUR_DOMAIN>", 
 "AUTH0_CLIENT_ID": "<YOUR_CLIENT_ID>", 
 "AUTH0_CLIENT_SECRET": "<YOUR_CLIENT_SECRET>", 
 "AUTH0_EXCLUDED": [ "organizations"] 
 }

@willvedd willvedd closed this as completed Apr 8, 2022
@nathanKramer
Copy link
Author

Thank you @willvedd!! this looks fantastic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants