Use HashiCorp Terraform to Manage Your Auth0 Configuration

How to use HashiCorp Terraform and the Auth0 Provider to maintain your critical infrastructure, including your Auth0 configuration, in code.

Learn more

Brought for you by John Brennan

Wohoooo! Finally Terraform and Auth0 integration! Let us know your thoughts in the comments below!

1 Like

Tip: If you receive a “Wrong email or password” error when you attempt to log in, there’s a chance that you need to disable other connections for your application. Head to your Auth0 Applications Dashboard, click on the “Terraform Secure Express” application, and click the “Connections” tab. Ensure that all connections except the terraform-express-user-db connection are disabled.

Any chance this could be automated via Terraform?

AFAIK, by default new applications are automatically enabled for all connections, which causes this type of problems, which is in itself not super easy to find out the first time (especially for new Auth0 users). If we could setup everything correctly using Terraform, that would be awesome!

1 Like

Howdy, Jonathan! Welcome to our Auth0 Community. Let me bring up this question internally with our Product Team to see if they may have any recommendations.

1 Like

Thank you for this provider, Alex!

Any way we can manage grants on the auth0 mgmt. API?

Using our Management API you can only get or delete grants:

https://auth0.com/docs/api/management/v2#!/Grants/get_grants

1 Like

Just to update you :slight_smile: I am still waiting for an answer on your question from our Product team :eyes: I’ve not forgotten.

Thanks Dan!

(FYI, different colleagues of mine tried to use Auth0, following more or less the content of that blog, and they all felt into that “all connections enabled for new clients” trap, each one of them :slight_smile: )

1 Like

Jonathan, I got a response for you! This Terraform integration is a collaboration with Alex Kalyvitis. I obtained the following recommendation from our team: The terraform-provider-auth0 Github project is the source of truth for all issues and feedback on the Terraform provider. You may visit the site and file an issue with your request as an enhancement. Let me know what you think, please :slight_smile:

1 Like

How we can export and import existing users to terraform ?

1 Like

Howdy, Vikram! Welcome to the Auth0 Community. I am researching your question internally. I’ll have an answer for you by next week as I get feedback on this feature.

Are there plans to allow any existing Auth0 resources to be imported to terraform state (not users)? For example we have a number of applications manually configured and would prefer not to have to recrete them in Terraform.

1 Like

Howdy, Luke. Welcome to the Auth0 community. Let me ask the team about importing existing Auth0 resources to Terraform state.

Vikram, we have something in the works to support exporting into Terraform using deploy-cli . We’ve created a draft PR that is available in the public repo and are in progress to update documentations that go with the repo before releasing it as an experimental feature. https://github.com/auth0/auth0-deploy-cli/pull/273

Luke, similar to what I replied to Vikram: We’ve created a draft PR that is available in the public repo and are in progress to update documentations that go with the repo before releasing it as an experimental feature. In addition to being able to export from Auth0 into terraform configurations, the experimental support for Rerraform will also support converting from existing deploy-cli configurations.https://github.com/auth0/auth0-deploy-cli/pull/273, which may fulfill your use case.