But I do not know which value to set for auth0_connection.my_conn.id
I tried this
data "auth0_connection" "github" {
name = "github"
}
# deactivate github social login for all
resource "auth0_connection_clients" "github_link" {
connection_id = data.auth0_connection.github.id
enabled_clients = [
]
}
But terraform apply fails with message │ The connection already has enabled clients attached to it. Import the resource instead in order to proceed with the changes. Run: ‘terraform import auth0_connection_clients.
│ con_8w5ut6Yq3oTFAzfv’.
I did not manage to find the proper terraform command
The reason you are encountering the error is precisely stated in the above mentioned error, so you’ll firstly need to import the resource in order to manage it.
The connection id can be easily be found in the Auth0 Dashboard - Authentication - Social - click on the specific Connection - and it’s listed near the Identifier field. It will always start with the con_ prefix.
However by following this pattern you’ll have to do this for all your connections. The reason why all social connections are automatically enabled when creating a new application is because of having the Enable Application Connections setting enabled. This can be disabled from the Tenant Settings > Advanced > Enable Application Connections, or when creating a new tenant in terraform with a setting such as:
resource "auth0_tenant" "tenant" {
# Other settings not shown here for simplicity.
flags {
enable_client_connections = false
}
}