Skip to content

Introduce + and change semantics of * for the --name-pattern index - #673

Merged
magodo (magodo) merged 2 commits into
Azure:mainfrom
magodo:any_or_always_name_pattern_index
Aug 19, 2026
Merged

Introduce + and change semantics of * for the --name-pattern index#673
magodo (magodo) merged 2 commits into
Azure:mainfrom
magodo:any_or_always_name_pattern_index

Conversation

@magodo

@magodo magodo (magodo) commented Aug 19, 2026

Copy link
Copy Markdown
Member

Changes include:

  • Introduce a "+" to indicate always append a number (starting from 1).
  • Change the semantic of "*" to only add the number if there is more than one names (starting from 2).
  • When absent, implicitly append "*" at the end of the name pattern.
  • The counting is now grouped by the Terraform resource group instead of globally incremented.

The main purpose is to make the extended name pattern templates that end up with a unique resource address to get rid of the 0 suffix. E.g. for azapi provider, it is practical to use --name-pattern "{type}", which will end up with azapi_resource.resource_groups0 before, but now azapi_resource.resource_groups.

- Introduce a "+" to indicate always append a number (starting from 1).
- Change the semantic of "*" to only add the number if there is more than one names (starting from 2).
- When absent, implicitly append "*" at the end of the name pattern.
Comment thread main.go Outdated
Co-authored-by: Gerry Tan <2316198+gerrytan@users.noreply.github.com>
@magodo
magodo (magodo) merged commit 3ab2e48 into Azure:main Aug 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants