Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A reference to a resource type must be followed by at least one attribute access, specifying the resource name #26551

Open
1 task done
nikhil0499 opened this issue Jul 5, 2024 · 0 comments

Comments

@nikhil0499
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.9.0

AzureRM Provider Version

3.105.0

Affected Resource(s)/Data Source(s)

azurerm_api_management_policy_fragment

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/Panic 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 Behaviour

Creation of policy fragments (there are three .xml files) and I am trying to loop these files and create the policy fragment of the .xml file name itself.

Actual Behaviour

│ 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)

Steps to Reproduce

No response

Important Factoids

No response

References

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant