Checklist
Description
Hi team,
I encountered a bug when using the auth0 tf generate command when we have at least one connection whose name consists only of digits (e.g., "123456").
Fetching data from Auth0... done
▸ Output directory "./" is not empty. Proceeding will overwrite the auth0_main.tf, auth0_import.tf and auth0_generated.tf files.
Generating Terraform configuration... failed
▸ Terraform resource config generated successfully but there was an error with terraform plan.
▸ Run ./terraform plan to troubleshoot
▸ Once the plan succeeds, run ./terraform apply to complete the import.
▸ The terraform binary and auth0_import.tf files can be deleted afterwards.
What I noticed:
When a Connection name start with a digit and contains other characters (e.g., "123aabbcc"). The generated terraform resource will be auth0_connection.aabbcc which is a valid resource name.
However, when the connection name only contains digits (e.g., "123456") the generation fails to generate the auth0_generated.tf file with the message Generating Terraform configuration... failed. And the auth0_import.tf file will contain an invalid import block as follows
import {
id = "con_<redacted>"
to = auth0_connection.
}
import {
id = "con_con_<redacted>"
to = auth0_connection_clients.
}
Actual result:
Only the following files are generated:
- auth0_import.tf
- auth0_main.tf
- terraform
Expectation
Terraform resources are generated successfully, including all the following files:
- auth0_import.tf
- auth0_main.tf
- auth0_generated.tf
- terraform
Reproduction
- Create a Entreprise Saml connection in Auth0 with a name that contains only numbers (e.g.,
123456).
- Run
auth0 tf generate to generate the Terraform configuration.
Auth0 CLI version
1.16.0
Checklist
Description
Hi team,
I encountered a bug when using the
auth0 tf generatecommand when we have at least one connection whose name consists only of digits (e.g.,"123456").What I noticed:
When a Connection name start with a digit and contains other characters (e.g.,
"123aabbcc"). The generated terraform resource will beauth0_connection.aabbccwhich is a valid resource name.However, when the connection name only contains digits (e.g.,
"123456") the generation fails to generate theauth0_generated.tffile with the messageGenerating Terraform configuration... failed. And theauth0_import.tffile will contain an invalid import block as followsActual result:
Only the following files are generated:
Expectation
Terraform resources are generated successfully, including all the following files:
Reproduction
123456).auth0 tf generateto generate the Terraform configuration.Auth0 CLI version
1.16.0