Skip to content

Exposing entity_guid for newrelic_alert_policys #3035

@abudri

Description

@abudri

Hello,

we were hitting an API limitation noted in the comment in #3018, and as a workaround we wanted to create/update a newrelic_workflow based upon tags and using the newrelic_entity_tags (btw, seems like it might be better that this singular as in newrelic_entity_tag but that's a side note).

And what we want to tag are our newrelic_alert_policys.

As can be seen, the guid is a required attribute of the newrelic_entity_tag resource.

However upon inspection of state of our existing newrelic_alert_policys, we find that the current version of the Terraform New Relic provider does not expose the entity_guid value for a given newrelic_alert_policy. This prevents us from tagging our newrelic_alert_policys usin the newrelic_entity_tag and thus managing tagging via New Relic Terrraform.

This then leads to us not being able to base our predicate for our newrelic_workflow on tags of the newrelic_alert_policys, because currently newrelic_alert_policy doesn't expose an entity_guid in state and thus can't fulfill the required attribute guid in a newrelic_entity_tags.

Terraform Version

1.10 and New Relic provider version is 3.76.2

Affected Resource(s)

newrelic_entity_tags
newrelic_alert_policy
newrelic_workflow

Terraform Configuration

We have a simple policy for example that shows up like this in TF state:

resource "newrelic_alert_policy" "my_policy" {
  account_id =  <SNIP>
  id = "abc123"
  incident_preference = "PER_POLICY"
  name = "name of my alert policy
}

We can not grab the entity_guid in the above, whereas for a newrelic_nrql_alert_condition we can see that entity_guid attribute.

This allows us to tag newrelic_nrql_alert_condition using newrelic_entity_tags, but we can't do so for newrelic_alert_policys without an entity_guid.

Of course New Relic Alert Policies do have entity GUIDs, the current version of the New Relic provider is simply not exposing them for us to use in our New Relic tag creation effort via Terraform

Actual Behavior

It is described above. We can't do the above described effort because of not exposing the entity_guid for newrelic_alert_policys.

Expected Behavior

We need the described data exposed for newrelic_alert_policys.

Steps to Reproduce

Create a newrelic_alert_policy and do a terraform state show newrelic_alert_policy.my_policy and it will show no guid value is available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions