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

Minor: suppress diff when trigger recipient id is specified #26

Closed
fitzoh opened this issue Aug 16, 2020 · 2 comments
Closed

Minor: suppress diff when trigger recipient id is specified #26

fitzoh opened this issue Aug 16, 2020 · 2 comments
Labels

Comments

@fitzoh
Copy link
Contributor

fitzoh commented Aug 16, 2020

provider version = 0.0.7

Disclaimer: this might be a bad idea.

I've got the following terraform configuration that applies successfully and works as expected:

data "honeycombio_trigger_recipient" "slack" {
  dataset = "my-very-special-datset"
  type    = "slack"
  target  = "#alerts"
}


resource "honeycombio_trigger" "trigger" {
  
 //query omitted

  recipient {
    id     = data.honeycombio_trigger_recipient.slack.id
  }
}

However, I receive the following when I run a plan/apply

 ~ recipient {
            id     = "some-id"
          - target = "#alerts" -> null
          - type   = "slack" -> null
        }

It would be nice if that diff could be suppressed without duplicating the recipient target and type.

@kvrhdn
Copy link
Contributor

kvrhdn commented Aug 16, 2020

Ah good call. This can be fixed by setting target and type as computed fields. In this case Terraform also accepts changes coming from the API.

Looking at the schema, id is computed but the other two fields of a recipient aren't.

@kvrhdn kvrhdn added the bug label Aug 16, 2020
kvrhdn pushed a commit that referenced this issue Aug 16, 2020
@kvrhdn kvrhdn closed this as completed in 2471d83 Aug 16, 2020
@kvrhdn
Copy link
Contributor

kvrhdn commented Aug 16, 2020

Didn't intend to push to main straight away, but this is fixed now 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants