Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve 'Name' Ambiguity #6

Open
rudiv opened this issue May 18, 2024 · 0 comments
Open

Resolve 'Name' Ambiguity #6

rudiv opened this issue May 18, 2024 · 0 comments
Labels
internal Internal API improvement

Comments

@rudiv
Copy link
Owner

rudiv commented May 18, 2024

Bicep resources sometimes effectively have 2 "Name"s.

The first (which is Name in the internal API) is the actual Bicep Resource Name, ie.

          \/ This
resource test 'Test/test@2023-01-01' = {

The second, which almost has a convention of AccountName for the existing few resources is the actual name of the resource, example in Cosmos DB:

resource cosmosDbAccount 'Microsoft.DocumentDB/databaseAccounts@2023-11-15' = {
                              name: 'cosmos${uniqueString(resourceGroup().id)}'
                                        ^ This

To avoid the ambiguity of Name being used for both there are a couple of options neither of which I'm sure is really better than the other:

  1. Remove the concept of the Resource Name as being customisable, so we would always "auto generate" a unique (but constant) string, which could be based off the "Account Name". This has the upside of removing any ambiguity as it becomes internal, but the downside of making Bicep (if synthed) more unreadable / usable outside of tooling.
  2. Standardise Name as ResourceName that can be overridden and used internally, leaving Name to be used when required by the resource definition itself.

Either of those work to remove the less defined Name property used for Bicep and reduce confusion when implementing new resources.

@rudiv rudiv added the internal Internal API improvement label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal API improvement
Projects
None yet
Development

No branches or pull requests

1 participant