terraform apply(plan)を実行すると、リソースの作成計画が表示されます。
計画を見ると"Plan: 3 to add"となっており、3つのリソースが作成されることが確認できます。
リソースグループ名がcount-rg-0からcount-rg-2となっていることも確認できます。
# azurerm_resource_group.count-rg[0] will be created
+ resource “azurerm_resource_group" “count-rg" { + id = (known after apply) + location = “eastus2" + name = “count-rg-0" }
# azurerm_resource_group.count-rg[1] will be created + resource “azurerm_resource_group" “count-rg" { + id = (known after apply) + location = “eastus2" + name = “count-rg-1" }
# azurerm_resource_group.count-rg[2] will be created + resource “azurerm_resource_group" “count-rg" { + id = (known after apply) + location = “eastus2" + name = “count-rg-2" }
terraform apply(plan)を実行すると、リソースの作成計画が表示されます。
計画を見るとPlan: 3 to addとなっており、3つのリソースが作成されることが確認できます。
リソースグループ名がeach-rg-dcXとなっていることが確認できます。
locationも、それぞれ異なる値が設定されていることが分かります。
# azurerm_resource_group.each-rg-01[“dc1"] will be created + resource “azurerm_resource_group" “each-rg-01" { + id = (known after apply) + location = “eastus2" + name = “each-rg-dc1" }
# azurerm_resource_group.each-rg-01[“dc2"] will be created + resource “azurerm_resource_group" “each-rg-01" { + id = (known after apply) + location = “japaneast" + name = “each-rg-dc2" }
# azurerm_resource_group.each-rg-01[“dc3"] will be created + resource “azurerm_resource_group" “each-rg-01" { + id = (known after apply) + location = “japanwest" + name = “each-rg-dc3" }
# azurerm_resource_group.each-rg-01[“eastus2"] will be created + resource “azurerm_resource_group" “each-rg-01" { + id = (known after apply) + location = “eastus2" + name = “each-rg-eastus2" }
# azurerm_resource_group.each-rg-01[“japaneast"] will be created + resource “azurerm_resource_group" “each-rg-01" { + id = (known after apply) + location = “japaneast" + name = “each-rg-japaneast" }
# azurerm_resource_group.each-rg-01[“japanwest"] will be created + resource “azurerm_resource_group" “each-rg-01" { + id = (known after apply) + location = “japanwest" + name = “each-rg-japanwest" }