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

Resource newrelic_notification_channel: property block issue with type MOBILE_PUSH #2781

Open
euskadi31 opened this issue Nov 28, 2024 · 1 comment
Labels
bug Something isn't working group-notifications

Comments

@euskadi31
Copy link

Hi

Terraform Version

Terraform v1.9.8
on darwin_arm64
+ provider registry.terraform.io/newrelic/newrelic v3.52.1

Affected Resource(s)

  • newrelic_notification_channel

Terraform Configuration

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

provider "newrelic" {
  account_id = var.newrelic_account_id
  api_key    = var.newrelic_api_key
  region     = "EU"
}


resource "newrelic_notification_destination" "mobile_push_channel" {
  account_id = var.newrelic_account_id
  name       = "[email protected] - Mobile Push"
  type       = "MOBILE_PUSH"

  property {
    key   = "userId"
    value = "100444444"
  }
}

resource "newrelic_notification_channel" "mobile_push_channel" {
  account_id     = var.newrelic_account_id
  name           = "Mobile Push - Monitoring"
  type           = newrelic_notification_destination.mobile_push_channel.type
  destination_id = newrelic_notification_destination.mobile_push_channel.id
  product        = "IINT"
}

Actual Behavior

The newrelic_notification_channel required a property, while using a newrelic_notification_destination of type MOBILE_PUSH does not require any, it is therefore impossible to make newrelic_notification_channel work correctly.

Expected Behavior

The property block should be optional for the MOBILE_PUSH type.

Steps to Reproduce

  1. Use the code above
  2. terraform plain

Debug Output

╷
│ Error: Insufficient property blocks
│ 
│   on newrelic_notifications.tf line 4, in resource "newrelic_notification_channel" "mobile_push_channel":
│    4: resource "newrelic_notification_channel" "mobile_push_channel" {
│ 
│ At least 1 "property" blocks are required.
@euskadi31
Copy link
Author

I found a way around the problem by adding a userId key and an empty value.

property {
  key   = "userId"
  value = ""
}

@pranav-new-relic pranav-new-relic added bug Something isn't working group-notifications labels Jan 2, 2025
@pranav-new-relic pranav-new-relic changed the title newrelic_notification_channel for MOBILE_PUSH Resource newrelic_notification_channel: property block issue with type MOBILE_PUSH Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working group-notifications
Projects
None yet
Development

No branches or pull requests

2 participants