Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform import of newrelic_alert_muting_rule resource without accountID results in crash #1145

Closed
6 tasks done
jaymcgrath opened this issue Jan 26, 2021 · 2 comments
Closed
6 tasks done

Comments

@jaymcgrath
Copy link
Contributor

jaymcgrath commented Jan 26, 2021

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

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

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
Terraform v0.14.2

Affected Resource(s)

Please list the resources as a list, for example:

  • newrelic_alerts_muting_rule

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

Terraform Configuration

provider newrelic {
  api_key = "NRxxxxxxxxxxxxxxxxxxxxxx"
  account_id = 1234567890
}
resource "newrelic_alert_muting_rule" "bar" {
  name = "tf-test-my-cool-rule-"
  enabled = true
  description = "terraform testing"
  condition {
    conditions {
      attribute = "tag"
      operator = "EQUALS"
      values = [
        "barbarbar"]
    }
    conditions {
      attribute = "conditionType"
      operator = "EQUALS"
      values = [
        "static"]
    }
    operator = "AND"
  }
  schedule {
    start_time = "2021-01-21T15:30:00"
    end_time = "2021-01-21T16:30:00"
    time_zone = "America/Los_Angeles"
    repeat = "WEEKLY"
    end_repeat = "2021-06-11T12:00:00"
    weekly_repeat_days = [
      "MONDAY",
      "FRIDAY",
      "TUESDAY",
    ]
  }
}

Actual Behavior

trying to import an existing rule using
terraform import "newrelic_alert_muting_rule.bar" "123456"

results in a crash

Expected Behavior

We should get some sort of error indicating that the format was invalid (accountId missing)

Steps to Reproduce

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

  1. add config
  2. terraform apply (grab the rule ID)
  3. rm terraform.tfstate (to set up a situation where import of existing resource is necessary)
  4. terraform import "newrelic_alert_muting_rule.bar" "RULE_ID_FROM_STEP_2"
  5. TF crashes

Debug Output

<script src="https://gist.github.com/jaymcgrath/6fb48c7540059c2e56a5a7eabcfe8be8.js"></script>

Version appears is 0.99, but this is a local version compiled from master w newrelic go client 0.56.1

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

@jaymcgrath jaymcgrath changed the title Terraform import of newrelic_alert_muting_rule resource results in crash Terraform import of newrelic_alert_muting_rule resource without accountID results in crash Feb 1, 2021
@stale
Copy link

stale bot commented Feb 15, 2021

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Feb 15, 2021
@stale
Copy link

stale bot commented Feb 22, 2021

This issue has been automatically closed due to a lack of activity for an extended period of time.

@stale stale bot closed this as completed Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant