splunk-terraform / terraform-provider-signalfx

Terraform SignalFx provider
https://www.terraform.io/docs/providers/signalfx/
Mozilla Public License 2.0
31 stars 71 forks source link

Data link target_external_url fails apply after change #265

Open axeljonson opened 3 years ago

axeljonson commented 3 years ago

When I create a 'signalfx_data_link' resource using the 'target_external_url' and run:

> terraform init
> terraform apply

Everything works fine. If I change anything in the dashboard including anything in the 'target_external_url' block and reapply I get the following error.

> terraform init
   .
   .
> terraform apply
Error: Bad status 400: {
  "code" : 400,
  "message" : "Cross link targets must have a label"
}

  on ../dashboards-application-health/datalinks.tf line 155, in resource "signalfx_data_link" "sql-2-splunk":
 155: resource "signalfx_data_link" "sql-2-splunk" {

The only way I can apply any changes to the dashboard is to go to the SFx UI and delete the data link manually. Then I can successfully update the dashboard including re-adding the data link again.

Here is what my TF configuration looks like.

resource "signalfx_data_link" "sql-2-splunk" {
  context_dashboard_id = signalfx_dashboard.from-dashboard.id
  property_name        = "sql_hashy"

  target_external_url {
    is_default          = true
    name                = "Splunk SQL Hash Lookup"
    time_format         = "EpochSeconds"
    minimum_time_window = 360000
    url                 = "https://our.signalfx.releam.com:8000/en-US/app/search/splunk_dashboard?{{ key }}={{ value }}&form.myTimePkr.earliest={{ start_time }}&form.myTimePkr.latest={{ end_time }}"
    property_key_mapping  = {
      sql_hashy = "sql_hash"
    }
  }
}

This is kind of a big deal as we are making changes to these dashboards regularly. Using the following versions:

terraform {
  required_providers {
    signalfx = {
      source = "splunk-terraform/signalfx"
      version = "~> 4.26.4"
    }
  }
  required_version = ">= 0.13"
}
axeljonson commented 3 years ago

I have also opened a SFx Customer Support ticket for this issue. https://signalfxsupport.force.com/s/case/5003m000015NGN3AAO/data-link-targetexternalurl-block-fails-on-terraform-updates

yuxinh3 commented 2 years ago

This is a big issue, which limits the datalink assigned to a dashboard, some of our use cases can never be achieved due to this limit.