Closed wylie-ucb closed 1 year ago
@wylie-ucb The mapping file format has been changed in v0.8.0, see: https://github.com/Azure/aztfy/releases/tag/v0.8.0. For the new format, please checkout the readme: https://github.com/Azure/aztfy#terrafy-a-predefined-set-of-resources
Thanks @magodo . I was using the mapping file from 0.7.0 since 0.8.0 isn't working for us. I'll wait for #276 to be built and try again.
@wylie-ucb Since we haven't get further response from you, I'll mark this issue as closed for now. Feel free to reopen it if the issue still remains.
We're trying to use the new map feature so we can import resources using friendly names (so replacing the default 'res-NN' names). During the initialization phase, the error is seen within a couple seconds.
Environment: azurerm version: 3.22.0 go version: go1.18.3 windows/amd64 terraform version: v1.2.2
Command:
$env:ARM_ENVIRONMENT = 'usgovernment'
aztfy map ..\.aztfyResourceMapping.json
Data:
{ "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]": "azurerm_resource_group.lz", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/azureFirewalls/[REDACTED]": "azurerm_firewall.lz", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/firewallPolicies/[REDACTED]": "azurerm_firewall_policy.lz", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/firewallPolicies/[REDACTED]/ruleCollectionGroups/DefaultApplicationRuleCollectionGroup": "azurerm_firewall_policy_rule_collection_group.lz_app", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/firewallPolicies/[REDACTED]/ruleCollectionGroups/DefaultDnatRuleCollectionGroup": "azurerm_firewall_policy_rule_collection_group.lz_dnat", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/firewallPolicies/[REDACTED]/ruleCollectionGroups/DefaultNetworkRuleCollectionGroup": "azurerm_firewall_policy_rule_collection_group.lz_net", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/virtualNetworks/[REDACTED]/subnets/[REDACTED]": "azurerm_subnet.lz_fw", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/publicIPAddresses/[REDACTED]": "azurerm_public_ip.lz_fw", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/virtualNetworks/[REDACTED]": "azurerm_virtual_network.lz", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/ipGroups/[REDACTED]": "azurerm_ip_group.afs", "/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.Network/ipGroups/[REDACTED]": "azurerm_ip_group.avd" }
Result:
unmarshalling the mapping file: json: cannot unmarshal string into Go value of type resmap.ResourceMapEntity
Note that issue #276 is also happening to us, and we are working in Azure US Gov