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

CloudIntegration was not matched against all PossibleTypes: CloudAwsMsElasticacheIntegration #2650

Closed wuetz closed 4 months ago

wuetz commented 5 months ago

❗❗ Update on mitigating this issue (from a maintainer of this repository)

Upgrade to v3.35.2+ (or) v3.36.0+ of the New Relic Terraform Provider. https://knowledge.newrelic.com/s/article/Error-interface-CloudIntegration-was-not-matched-against-all-PossibleTypes-CloudAwsMsElasticacheIntegration

Summary

Hi there,

all of the sudden this message appears, whcih was definetly not existing yesterday:

╷
│ Error: interface CloudIntegration was not matched against all PossibleTypes: CloudAwsMsElasticacheIntegration
│
│   with module.new-relic-core.newrelic_cloud_aws_link_account.this[0],
│   on .terraform/modules/new-relic-core/account.tf line 1, in resource "newrelic_cloud_aws_link_account" "this":
│    1: resource "newrelic_cloud_aws_link_account" "this" {
│
╵

We noticed this on ANY terraform infrastructure having an newrelic aws linked account... In our case around 30 AWS accounts..

Also the upgrade to the latest newrelic provider did not solve the issue.

Terraform Version

Terraform v1.7.5 on linux_amd64

Your version of Terraform is out of date! The latest version is 1.8.2. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

Terraform Configuration

Please include your provider configuration (sensitive details redacted) as well as the configuration of the resources and/or data sources related to the bug report.


provider "newrelic" {
account_id = var.new_relic_account_id
# Use the api key out of the ENV var NEW_RELIC_API_KEY
region = "EU" # Valid regions are US and EU
alias  = "europe"
}

[...] terraform { required_version = ">= 1.1.7" required_providers { [...] newrelic = { source = "newrelic/newrelic" version = "~> 3.35.1" } }



### Actual Behavior
All of the sudden the above error shows up.

### Expected Behavior
no error

### Steps to Reproduce
Just do an terraform apply. No changes were done to the code or infra, but over night this error showed up:
1. `terraform apply`
pranav-new-relic commented 5 months ago

Hi @wuetz and everyone else watching this issue - we're looking into this. Please give us some time so we can validate this issue and plan on subsequent action 👍

vw-hm commented 5 months ago

Thank you. This is affecting our production pipelines. Appreciate you looking into it.

pranav-new-relic commented 5 months ago

Is it possible for any of you to share your configuration and trace/debug logs when you see this error, so we can investigate this better? It looks like something's not in place with this new integration (msElasticCache) added to the cloudConfigureIntegration mutation on NerdGraph, and in the read response, it seems to be returning a type though there exists no configured integration. All of these are my thoughts, while we continue to investigate into this.

vw-hm commented 5 months ago

@pranav-new-relic - They are shared in the support case https://support.newrelic.com/s/case-details?caseId=500Ph00000AiBlC

Please feel free to contact me via the contacts mentioned in the case for further collaboration.

pranav-new-relic commented 5 months ago

Update: While we continue to diagnose the actual cause of this issue, we're trying to (soon) cut a release of the Terraform Provider which would include a fix to this issue. I shall keep y'all posted soon.

yanavery commented 5 months ago

Thanks for looking into this. For the time being is there some kind of workaround to this as this is impacting our production deployment pipelines? Thank you!

pranav-new-relic commented 5 months ago

We've just released v3.35.2 of the Terraform Provider with a fix to this issue - can you please upgrade to this and give it a try? You shouldn't see the issue with this version.

wuetz commented 5 months ago

@pranav-new-relic looks quite ok on the first try.

vw-hm commented 5 months ago

@pranav-new-relic 3.35.2 worked for us. Thank you

pranav-new-relic commented 5 months ago

Thanks for validating the fix, folks. Appreciate your help :)

Panzki commented 5 months ago

We're using the New Relic Terrraform provider with cdktf and I can confirm that updating the cdktf provider bindings to v12.6.2 resoled the issue for us as well. Thanks for providing a fix so quickly.

yanavery commented 5 months ago

Works for us too. Thanks!