Closed nikhil0499 closed 2 days ago
I am trying to iterate the .xml files(which contains policy fragments of Azure APIM) , and deploy this in the APIM
Hello @nikhil0499, this appears to be an issue or question with the AzureRM provider, not with Terraform itself. You can see existing issues and file a new one in their repository here: https://github.com/terraform-providers/terraform-provider-azurerm/issues. If you have questions about Terraform or the AzureRM provider, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by a few core maintainers. Thanks!
Terraform Version
Terraform Configuration Files
resource "azurerm_api_management_policy_fragment" "policy_fragments" { for_each = fileset(var.policy_fragments_dir, "*.xml") api_management_id = var.apim_instance_ids[var.environment] name = each.key format = "xml" value = file("${var.policy_fragments_dir}/${each.key}") }
Debug Output
│ Error: Invalid reference │ │ on ../../../../modules/api_policy_fragments/main.tf line 16, in resource "azurerm_api_management_policy_fragment" "policy_fragments": │ 16: name = sample │ │ A reference to a resource type must be followed by at least one attribute │ access, specifying the resource name. ╵ Operation failed: failed running terraform plan (exit 1)
Expected Behavior
Create all of the policy fragments
Actual Behavior
A reference to a resource type must be followed by at least one attribute access, specifying the resource name.
Steps to Reproduce
1.terraform init 2.terraform plan
Additional Context
No response
References
No response