Auth0 Terraform Provider 1.0.0-beta.2 Missing Client Secret
Last Updated:
Overview
This article explains how to expose the m2m-client client_secret when creating an action and managing it with the new 1.0.0-beta2 Terraform Provider. The client_secret was available in versions before 1.0.0-beta2.
The configuration below results in the following error:
**Error: Unsupported attribute error** when running **terraform validate**.
```
resource "auth0_action" "my_action" {
name = "My Action"
code = file("../source/actions/MyAction.js")
runtime = "node18"
deploy = true
supported_triggers {
id = "post-login"
version = "v3"
}
depends_on = [ auth0_connection.username_password
]
dependencies {
name = "auth0"
version = "3.7.0"
}
secrets {
name = "ACTIONS_CLIENT_ID"
value = auth0_client.actions.client_id
}
secrets {
name = "ACTIONS_CLIENT_SECRET"
value = auth0_client.actions.client_secret
}
}Applies To
- Terraform Provider 1.0.0-beta.2
- Missing Client Secret
Cause
Several breaking changes have been introduced with v1.0, and this change is by design and is outlined in the migration guide for migrating from Upgrading from v0.x → v1.0.
The changes regarding reading client secrets can be found in the following Github migration guide: Reading Client Secret
Solution
To read the Client Secret in version 1.0.0-beta.2, modify the code to the following:
BEFORE:
resource "auth0_client" "my_client" {
#...
}
output "my_client_secret" {
value = auth0_client.my_client.client_secret
}
AFTER:
data "auth0_client" "my_client" {
client_id = auth0_client.my_client.id
}
output "my_client_secret" {
value = data.auth0_client.my_client.client_secret
}