GithubHelp home page GithubHelp logo

Comments (5)

ss-remygreinhofer avatar ss-remygreinhofer commented on June 30, 2024
$ terraform --version
Terraform v0.11.10
+ provider.newrelic v1.2.0

We are using the newest version of terraform and the newrelic provider, but we are still facing the problem described in this issue.

Our policies and channels are correctly imported, but none of the conditions get linked to them. As a consequence, tf plan wants to recreate all of them.

from terraform-provider-newrelic.

thejohnlin avatar thejohnlin commented on June 30, 2024

@ghstwhl
I ran into this issue recently and did some poking around.

I noticed you ran terraform import with what looks to be a policy ID.

If you take a look at the code beneath the covers, the provider is parsing the ID passed into terraform import and expecting two pieces: both the policy ID and the condition ID with a colon in the middle.

https://github.com/terraform-providers/terraform-provider-newrelic/blob/master/newrelic/resource_newrelic_alert_condition.go#L308

https://github.com/terraform-providers/terraform-provider-newrelic/blob/51875a56e41549e25dc74df484921412159bebf9/newrelic/helpers.go#L10

https://github.com/terraform-providers/terraform-provider-newrelic/blob/master/newrelic/resource_newrelic_alert_condition.go#L313-L314

If you import using <policy_id>:<condition_id>, you might see what I'm seeing now... which is a marshaling issue between float64 and string on the "threshold" field. The underlying alert_conditions API returns conditions given a policy ID.

from terraform-provider-newrelic.

ashwin1dd avatar ashwin1dd commented on June 30, 2024

Running into this as well. Has anyone been able to work around this?

from terraform-provider-newrelic.

thejohnlin avatar thejohnlin commented on June 30, 2024

Running into this as well. Has anyone been able to work around this?

When I changed the type of the threshold field to be a string instead of float64, I was able to get it working.

from terraform-provider-newrelic.

sanderblue avatar sanderblue commented on June 30, 2024

@ghstwhl Apologies for a delay in response. We've recently focused more resources on maintaining the provider and in doing so, we've updated the Terraform provider to our new client, newrelic-client-go. In doing so, I have a hunch this might have been fixed as part of that update (or potentially as a result of other updates/fixes). I was unable to reproduce the primary reported problem with the current version of our provider, v1.12.2. I was also unable to reproduce the marshaling bug reported by @thejohnlin. Closing the issue since this looks to be resolved, but if anyone runs into any other issues please feel free to open new issue with your scenario.

from terraform-provider-newrelic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.