You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Working with terraform-azurerm-caf and having to import lots of cloud resources it leaves azurecaf_name
(even with passthrough = true) as a dependency to the actual resources.
Leaving the last ones in recreate state, even if the name is exactly the same.
# module.solution.module.batch_accounts["batch_account"].azurecaf_name.account will be created
+ resource "azurecaf_name" "account" {
+ clean_input = true
+ id = (known after apply)
+ name = "BA"
+ passthrough = true
+ random_length = 0
+ resource_type = "azurerm_batch_account"
+ result = (known after apply)
+ results = (known after apply)
+ separator = "-"
+ use_slug = true
}
# module.solution.module.batch_accounts["batch_account"].azurerm_batch_account.account must be replaced
# (imported from "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG/providers/Microsoft.Batch/batchAccounts/BA")
# Warning: this will destroy the imported resource
-/+ resource "azurerm_batch_account" "account" {
~ account_endpoint = "BA._.batch.azure.com" -> (known after apply)
~ id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG/providers/Microsoft.Batch/batchAccounts/BA" -> (known after apply)
~ name = "BA" # forces replacement -> (known after apply) # forces replacement
Describe the solution you'd like
Probably it would defeat the whole purpose to have the ability to run the import command (somehow).
But I am raising this at a discussion level.
(Maybe this would be a topic for terraform-azurerm-caf project; and instead of resource "azurecaf_name" there should be data "azurecaf_name")
Update: I was rethinking this and data "azurecaf_name" makes sense only when passthrough = true 😊
Describe alternatives you've considered
As silly as it seemed, I tried running the import command: Error: resource azurecaf_name doesn't support import
The text was updated successfully, but these errors were encountered:
I think the scope of this issue is more then just with import, - it's with unnecessary "known after apply" status of the result output of azurecaf_name resource. Even when all inputs are known upfront, for some reason it can't assemble the name until apply.
Is your feature request related to a problem? Please describe.
Working with
terraform-azurerm-caf
and having to import lots of cloud resources it leavesazurecaf_name
(even with
passthrough = true
) as a dependency to the actual resources.Leaving the last ones in recreate state, even if the name is exactly the same.
# module.solution.module.batch_accounts["batch_account"].azurecaf_name.account will be created + resource "azurecaf_name" "account" { + clean_input = true + id = (known after apply) + name = "BA" + passthrough = true + random_length = 0 + resource_type = "azurerm_batch_account" + result = (known after apply) + results = (known after apply) + separator = "-" + use_slug = true } # module.solution.module.batch_accounts["batch_account"].azurerm_batch_account.account must be replaced # (imported from "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG/providers/Microsoft.Batch/batchAccounts/BA") # Warning: this will destroy the imported resource -/+ resource "azurerm_batch_account" "account" { ~ account_endpoint = "BA._.batch.azure.com" -> (known after apply) ~ id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG/providers/Microsoft.Batch/batchAccounts/BA" -> (known after apply) ~ name = "BA" # forces replacement -> (known after apply) # forces replacement
Describe the solution you'd like
Probably it would defeat the whole purpose to have the ability to run the import command (somehow).
But I am raising this at a discussion level.
(Maybe this would be a topic for
terraform-azurerm-caf
project;and instead of)resource "azurecaf_name"
there should bedata "azurecaf_name"
Update: I was rethinking this and
data "azurecaf_name"
makes sense only whenpassthrough = true
😊Describe alternatives you've considered
As silly as it seemed, I tried running the import command:
Error: resource azurecaf_name doesn't support import
The text was updated successfully, but these errors were encountered: