Replies: 4 comments
-
|
I've proposed a fix for this issue in this PR #1294 I opened. I hope it's a satisfying solution! The fix handles the case where connection names start with a digit by prefixing them with an underscore to make valid Terraform resource names. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @Ga13Ou , Thank you for bringing this issue and with the solution. We appreciate your suggestion and acknowledge the challenge with connection names that consist solely of digits. Unfortunately, supporting purely numeric names presents complications especially around resource sanitization and the risk of creating duplicate resources (e.g., both Given these concerns, we have decided not to add additional sanitize. Instead, we recommend using connection names that contain at least one non-numeric character to ensure compatibility with Terraform resource naming conventions and avoid potential conflicts. Thank you for your understanding and for contributing to the improvement of the CLI. suggestions, feel free to let us know! |
Beta Was this translation helpful? Give feedback.
-
|
Hi @ramya18101 , Thanks a lot for taking the time to look into this and provide a detailed explanation! I totally understand the concern about resource name collisions and the need to avoid ambiguous or duplicate Terraform resources. However, I’d like to point out that the risk of collision already exists in the current sanitization logic — even before introducing a leading underscore for numeric-only names. For example, different connection names like Also, renaming the connection isn’t always a viable workaround. In our case, the connections already exist in production, are referenced by other systems, and Auth0 doesn’t allow renaming them after creation — so we’re constrained to working with the current names. That said, we’ve already built our own auth0 binary locally with the updated sanitization logic to unblock our workflow and successfully generate the Terraform code. Thanks again for your work on the CLI — it’s a great tool and this was the only hiccup we encountered so far! |
Beta Was this translation helpful? Give feedback.
-
|
@Ga13Ou Hello 👋 At the inception of the CLI, we did add a few rules - but we’re trying to avoid introducing additional sanitization logic at this point in time. Our goal is to align with Terraform core rules, and the official guidance from HashiCorp is to avoid naming resources that start with numbers. Also, it doesn’t look like that’s going to change anytime soon. And I totally understand your constraints around existing production connections. Renaming or recreating them isn't feasible. All said, we’ll definitely give this more thought for a future major release and see if we can make the Also, thank you for the kind words - glad to hear the tool has been working well for you! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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
Beta Was this translation helpful? Give feedback.
All reactions