terraform-provider-newrelic icon indicating copy to clipboard operation
terraform-provider-newrelic copied to clipboard

workflow_enabled is ignored

Open jbhardman opened this issue 2 years ago • 2 comments

Hi there,

Thank you for opening an issue. In order to better assist you with your issue, we kindly ask to follow the template format and instructions. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests only. General usage questions submitted as issues will be closed and redirected to New Relic's Explorers Hub https://discuss.newrelic.com/c/build-on-new-relic/developer-toolkit.

Please include the following with your bug report

:warning: Important: Failure to include the following, such as omitting the Terraform configuration in question, may delay resolving the issue.

  • [x] Your New Relic provider configuration (sensitive details redacted)
  • [x] A list of affected resources and/or data sources
  • [x] The configuration of the resources and/or data sources related to the bug report (i.e. from the list mentioned above)
  • [x] Description of the current behavior (the bug)
  • [x] Description of the expected behavior
  • [ ] Any related log output

Terraform Version

╰─ $ terraform -v Terraform v1.2.8 on linux_amd64

  • provider registry.terraform.io/newrelic/newrelic v3.0.1

Affected Resource(s)

Please list the resources as a list, for example:

  • newrelic_workflow

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

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.

terraform {
  required_providers {
    newrelic = {
      source = "newrelic/newrelic"
      version = "3.0.1"
    }
  }
}

provider "newrelic" {
  # Configuration options
  account_id = "IDGOESHERE"
  api_key = "APIKEYGOESHERE"
  region = "US"
}

resource "newrelic_workflow" "tf_workflow" {
  name = "tf-workflow"
  account_id = var.account_id
  muting_rules_handling = "NOTIFY_ALL_ISSUES"
  workflow_enabled = false

  enrichments {
    nrql {
      name = "Log count"
      configurations {
       query = "SELECT count(*) FROM Log"
      }
    }
  }

  issues_filter {
    name = "Filter-name"
    type = "FILTER"

    predicates {
      attribute = "accumulations.sources"
      operator = "EXACTLY_MATCHES"
      values = [ "newrelic" ]
    }
  }

  destination_configuration {
    channel_id = newrelic_notification_channel.tf_webhook_channel.id
  }
}

Actual Behavior

Workflow is always enabled.

Expected Behavior

Workflow should be disabled

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Generate the configuration for a new (or modify an existing) workflow.
  2. terraform apply
  3. See success message.
  4. Refresh browser and see workflow is still enabled.

jbhardman avatar Aug 29 '22 23:08 jbhardman

Hi @jbhardman Thanks for raising the issue, we will prioritise this issue.

shiva-bandari avatar Aug 30 '22 12:08 shiva-bandari

Hello,

The same issue also applies to the following attributes:

  • destinations_enabled
  • enrichments_enabled

AdrienKuhn avatar Sep 13 '22 15:09 AdrienKuhn

The issue should be resolved in the next release of our TF provider

IliaShurygin avatar Oct 20 '22 12:10 IliaShurygin

The issue has been fixed in v3.5.2 for all boolean flags in workflows (destinations_enabled, enrichments_enabled, enabled)

That being said, I would advice against using destinations_enabled and enrichments_enabled flags:

  • destinations_enabled: please use enabled instead, it does the same thing but better because you'll be able to at least see it in the UI
  • enrichments_enabled: just remove enrichments if you do not need them; if you do not have any enrichments, this flag does not do anything

We will most likely remove both flags in the future.

IliaShurygin avatar Oct 21 '22 15:10 IliaShurygin

We got and verified a report that the flag does not work again, at least when creating a new workflow. I am reopening the ticket for now for visibility.

The issue only affects workflow creation, not updated. So as a workaround, please run terraform apply one more time after creation. We have already identified the root cause and hope to roll out a fix next week

IliaShurygin avatar Nov 25 '22 17:11 IliaShurygin

The issue with new workflows has been fixed in v3.11.0

IliaShurygin avatar Dec 16 '22 20:12 IliaShurygin