Refer to: https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli
- Select the target workspace
terraform workspace list
terraform workspace select sit
terraform workspace new uat
- Run terraform init
terraform init
- Set environment variables by substituting AUTHO_DOMAIN, CLIENT_ID, and CLIENT_SECRET for your M2M app's values. Refer to
export AUTH0_DOMAIN=******
export AUTH0_CLIENT_ID=******
export AUTH0_CLIENT_SECRET=******
- Run terraform plan/apply
terraform plan -var-file=$(terraform workspace show).tfvars
terraform apply -var-file=$(terraform workspace show).tfvars
- TF state files are stored in this repository
- Workspace is being used to distinguish between different environments, so remember to select the correct workspace before proceeding
- Auth0 app values are required to be set in env var before applying and the values are not supposed to be included in the scripts here
- Export the configuration for a defined resource
terraform import auth0_client.api_client xWRYU7RI8dRBwDvprd0ZrhQRQXFCqF6L
- Output the specific resource in HCL
terraform state show auth0_client.api_client
- Copy & paste the output into tf file
Refer to: https://registry.terraform.io/providers/auth0/auth0/latest/docs