A custom provider for terraform.
- Download the latest release for your platform
- rename the file to
terraform-provider-auth0
- Copy the file to the same directory as terraform
dirname $(which terraform)
is installed
Provides an auth0 client
provider "auth0" {
domain = "abc.eu.auth0.com"
client_id = "<CLIENT_ID>"
client_secret = "<CLIENT_SECRET>"
}
resource "auth0_client" "test-client" {
name = "p-test-dev2"
is_token_endpoint_ip_header_trusted = true
is_first_party = false
description = ""
cross_origin_auth = false
sso = true
token_endpoint_auth_method = "client_secret_post"
grant_types = [ "authorization_code", "implicit", "refresh_token", "client_credentials" ]
app_type = "non_interactive"
custom_login_page_on = true
}
The output will look like this:
resource.auth0_client.test-client.client_id = "generated_client_id"
resource.auth0_client.test-client.client_secret = "generated_client_secret"
Arguments have the same names as provided in Auth0 Management API documentation (https://auth0.com/docs/api/management/v2#!/Clients).
The provider itself requires 3 parameters:
domain
- The provided domain for the Auth0 accountclient_id
- The client ID for the Applicationclient_secret
- The client secret for the Applicaton.
You can consult the Auth0 Documentation for steps on creating a Machine-to-Machine Application in your Auth0 tenant with access to its Auth0 Management API.
Optionally, you may also manually specify a token using the access_token
parameter:
provider "auth0" {
domain = "abc.eu.auth0.com"
access_token = "<ACCESS_TOKEN>"
}
When you do this, the provider will not request a token on your behalf.
client_id
- The client ID of the new clientclient_secret
- The client secret of the new client
go get github.com/dnna/terraform-provider-auth0
cd $GOPATH/src/github.com/dnna/terraform-provider-auth0
go get ./...
$EDITOR .