newrelic / terraform-provider-newrelic

Terraform provider for New Relic
https://registry.terraform.io/providers/newrelic/newrelic/latest/docs
Mozilla Public License 2.0
202 stars 245 forks source link

interface CloudIntegration was not matched against all PossibleTypes: CloudAwsMsElasticacheIntegration #2656

Closed stephen-sgodfrey-softrams closed 4 months ago

stephen-sgodfrey-softrams commented 5 months ago

I'm adding this bug report just to track an issue we had and then fixed.

Our New Relic terraform module was working fine for the past 2 years, and then all of a sudden we started to see this issue:

Error: interface CloudIntegration was not matched against all PossibleTypes: CloudAwsMsElasticacheIntegration
│
│   with module.new-relic.newrelic_cloud_aws_link_account.newrelic_cloud_integration_push,
│   on ../../modules/new-relic/main.tf line 46, in resource "newrelic_cloud_aws_link_account" "newrelic_cloud_integration_push":
│   46: resource "newrelic_cloud_aws_link_account" "newrelic_cloud_integration_push" {

It's a pretty easy fix. You just need to upgrade your new relic provider version to the latest 2.x version. We were on version 2.49.1, and upgraded to 2.50.2 and that fixed it, but decided to try upgrading to the latest (3.35.2 as of the time of writing) and that worked as well.

So I changed my terraform config, ran a terraform init -upgrade, and it worked.

terraform {
  required_version = "~> 1.5.7"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.67.0"
    }
    newrelic = {
      source  = "newrelic/newrelic"
      version = "~> 3.35.2"
    }
  }
}

Anyway, I wanted to put this here just to help someone else in case they ran across the same issue. You can mark this as resolved if you like.

jdrydn commented 5 months ago

Been digging into this all day as this broke our deployment pipeline too - thanks for sharing!

We've just bumped our version from 3.26.1 which has resolved the issue.

There's nothing clear in the changelog to explain why this is broken or what the (underlying?) breaking change is - I suspect this is a bug on the New Relic provider API rather than the client.

stephen-sgodfrey-softrams commented 5 months ago

I agree. They probably made a requirement, and there is some list in there that compares CloudAwsMsElasticacheIntegration against a list somewhere and that broke things.

Though it's an easy fix, I think this is an issue on the new relic side where perhaps they need to version an API change.

pranav-new-relic commented 5 months ago

Hello everyone, thank you for posting this - this would certainly help other customers figure this out. We've been posting updates about this issue in #2650 / #2652; one of which is that we just released v3.35.2 of the Terraform Provider with a fix to this issue. Thanks for sharing this, folks.