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

Notification policy with multiple email ids not possible neither when importing nor when applying. #1915

Closed
2 tasks done
Done203 opened this issue Sep 16, 2022 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@Done203
Copy link

Done203 commented Sep 16, 2022

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.2.9
on windows_386

  • provider registry.terraform.io/cloudflare/cloudflare v3.23.0

Affected resource(s)

cloudflare_notification_policy

Terraform configuration files

resource "cloudflare_notification_policy" "example_name" {
  account_id = "<account_id>"
  alert_type = "health_check_status_notification"
  enabled    = true
  name       = "example_name"

  description = ""
  email_integration {
    id = ["colleague1@company.com", "colleague2@company.com"] ### not possible! ###
  }
  filters {
    health_check_id = ["<healthcheck_id>"]
    status          = ["Healthy", "Unhealthy"]
  }
}

Link to debug output

https://gist.github.com/Done203/54c96e80afc31dd2b5b431682e0093d4

Panic output

│ Error: Incorrect attribute value type

│ on main_notifications.tf line 63, in resource "cloudflare_notification_policy" "example_name":
│ 63: id = ["colleague1@company.com",
│ 64: "colleague2@company.com",
│ 65: "colleague3@company.com"]

│ Inappropriate value for attribute "id": string required.

Expected output

Plan: 1 to add, 0 to change, 0 to destroy.

Actual output

Inappropriate value for attribute "id": string required.

Steps to reproduce

  1. create a cloudflare_notification_policy ressource with multiple values for the id field in the email_integration block.
  2. try to apply / validate

Additional factoids

This is my first time working with Terraform so apologies if its an error on my part.

Creating a notification with multiple emails is impossible with the cloudflare ressource due to the id field of the email_integration block requiring just a string, though its possible on the cloudflare website.

Out of curiosity i imported an existing notification policy with multiple emails and i've found out that terraform takes only the last email of the policy and saves it in the state file.

I'd like the id field of the email_integration block to be a set of strings instead of a string to make multiple emails for a single notification policy possible. Maybe this might also fix the incorrect (?) import.

References

none

@Done203 Done203 added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 16, 2022
@Done203 Done203 closed this as completed Sep 16, 2022
@Done203
Copy link
Author

Done203 commented Sep 16, 2022

Fortunately just an error on my part.
It appears that each email-id needs its own email_integration block... wasn't clear to me when i read the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

1 participant