This guide provides steps for configuring terraform.
See this reference
for documentation on the auth0
terraform provider.
-
Create an
auth0
account -
Navigate to the Application Dashboard
-
Click on "Create Application"
-
In the form that pops up, give your app a name like "Terraform Auth0 Provider" and select "Machine to Machine Application" as the type.
-
You'll need to authorize your new app to call the "Auth0 Management API". Select it in the dropdown and then authorize all scopes by clicking "All" in the top right of the scopes selection area. Click the "Authorize" button to continue.
-
You'll be taken to the details page for your new application. Open the "Settings" tab and copy the Client ID, Client Secret, and Domain values.
-
Create a new file named
terraform/deploy.tfvars
and fill in the Client ID, Client Secret, and Domain values from the previous step, e.g.:auth0_client_id = "<YOUR_CLIENT_ID>" auth0_client_secret = "<YOUR_CLIENT_SECRET>" auth0_domain = "<YOUR_DOMAIN>"
-
Create the resources for the application:
terraform init terraform apply -var-file="deploy.tfvars"
-
Make a copy of the
.env.example
file in the root directory, and name.env
. Navigate back to the Application Dashboard and use theTerraform Veritas
application to fill in the values below:AUTH0_CLIENT_ID= AUTH0_DOMAIN= AUTH0_SECRET=<ANY_LONG_RANDOM_STRING>
-
Navigate back to the Application Dashboard and use the
Terraform Veritas M2M
application to fill in the values below:AUTH0_M2M_CLIENT_ID= AUTH0_M2M_CLIENT_SECRET=
-
Set the "Default Directory" by navigating to the Auth0 Dashboard click on the dropdown in top left-hand corner, select "Settings", in the "API Authorization Settings" section set the "Default Directory" to
terraform-veritas-db
, and "Save" the changes.
If you would like to destroy the resources at any time use:
terraform destroy -var-file="deploy.tfvars"