Skip to content

--name-pattern-value should allow variables from resource types, resource groups, or resource providers #183

Description

@MohnJadden

I'd like to be able to use --name-pattern-value to name resources based on their resource group and what type of resource it is, and to add a unique name to each. The logic here is that I'm taking Azure RGs based on their use case, and I want to have them pull names according to a standardized naming convention for ease of future management.

The way aztfy works now is that I can't figure out how to use --name-pattern-value to pull these details. For example, if I'm using aztfy to pull in resources from the MarketingVDI resource group, I'd like the resources to be managed within Terraform as follows:

Host pool: azurerm_virtual_desktop_host_pool.MarketingVDI
VM login assignment: azurerm_role_assignment.MarketingVDI

Whereas if I'm using it to pull from LegalDeepStorage, the resource names should be:

Storage account: azurerm_storage_account.LegalDeepStorage
Activity log alert: azurerm_monitor_activity_log_alert.LegalDeepStorage

(These are just examples - I know aztfy doesn't do every resource provider yet)

The end goal would be something like aztfy rg LegalDeepStorage --name-pattern-value %HCLResourceProviderType%_%ResourceGroupName%, or other identifying placeholders - maybe %SubscriptionName%, %ValueOfTagKeyNamedX%, or other details that ARM might be able to pull.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions