Closed Hasgaroth closed 1 month ago
Thanks for creating this issue, @Hasgaroth. We'll take a look at this sometime soon based on our current priority queue, and revert with some findings to share.
Hey @Hasgaroth Support for retrieving tags of an entity using this data source has been added with 3.38.0 of the Terraform provider, please see this example; this might not entirely suffice your usecase since some tags associated with the entity are reserved, which when managed by the newrelic_entity_tags
resource or the underlying NerdGraph mutation would thrown an error, but we'd suggest you to give this a try.
This resolves our issues with extracting tags via the newrelic_entity
data source, thanks!
Hi, We are having an issue with the NewRelic data source
newrelic_entity
which is not returning any tags associated with the resources that are found through the use of the data source.Affected Resource
newrelic_entity
data sourceVersion information
Current Behaviour
newrelic_entity
data source doesnot
return the tags associated with the found entityExpected Behaviour
newrelic_entity
data source returns a data map containing the tags associated with the found entityFull Description
The documentation for this data source gives the option of providing tags as part of the search criteria, and for the output attributes that are exported, it states
In addition to all arguments above, the following attributes are exported
. So we would expect that all the tags that are assigned to the discovered entity will be exported with the rest of the attributes.Unfortunately, there are no tags exported as part of the object attribute data.
This is now causing a perpetual
diff
in our Terraformplan
results, as we have an automated process that adds tags to resources based on other tag information that is present. The NewRelic provider does not give us the ability to ignore a set of these added tags, so decides that the tags need to be removed.Running the
apply
for the resources then removes these tags, but the automated process re-adds them the next time it runs, meaning that the Terraformplan
output will again show the drift in the tags.The AWS provider gives the ability to provide a set of default tags for all resources, but also the ability to ignore certain tags so that they do not conflict with the Terraform controlled tags.
What I was trying to do to get around this issue, is to extract all the tags associated with an entity using the
newrelic_entity
data source, and thenmerge
those extracted tags with the ones I want to maintain, so that Terraform places all the tags under control, even though they are not part of my configuration.