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

cloudflare_notification_policy alert_type=incident_alert & alert_type=maintenance_event_notification property missing #2882

Closed
2 tasks done
imadarangi opened this issue Oct 25, 2023 · 4 comments
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature.

Comments

@imadarangi
Copy link

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.5.7
on linux_amd64

Affected resource(s)

cloudflare_notification_policy

Terraform configuration files

resource "cloudflare_notification_policy" "notification_policy" {
  account_id  = var.account_id
  name        = "Cloudflare Incident Status Alerts"
  description = "Alert if Cloudflare is experiencing an incident"
  enabled     = true
  alert_type  = "incident_alert"
  email_integration {
    id = "myemail@example.com"
  }
resource "cloudflare_notification_policy" "notification_policy" {
  account_id  = var.account_id
  name        = "Cloudflare Maintenance Status Alerts"
  description = "Alert if Cloudflare Maintenance"
  enabled     = true
  alert_type  = "maintenance_event_notification"
  email_integration {
    id = "myemail@example.com"
  }
}

Link to debug output

Pasted Below

Panic output

Initializing plugins and modules...

│ Error: expected alert_type to be one of [access_custom_certificate_expiration_type advanced_ddos_attack_l4_alert advanced_ddos_attack_l7_alert bgp_hijack_notification billing_usage_alert block_notification_block_removed block_notification_new_block block_notification_review_rejected clickhouse_alert_fw_anomaly clickhouse_alert_fw_ent_anomaly custom_ssl_certificate_event_type dedicated_ssl_certificate_event_type dos_attack_l4 dos_attack_l7 expiring_service_token_alert failing_logpush_job_disabled_alert fbm_auto_advertisement fbm_dosd_attack fbm_volumetric_attack health_check_status_notification hostname_aop_custom_certificate_expiration_type http_alert_edge_error http_alert_origin_error load_balancing_health_alert load_balancing_pool_enablement_alert real_origin_monitoring scriptmonitor_alert_new_code_change_detections scriptmonitor_alert_new_hosts scriptmonitor_alert_new_malicious_hosts scriptmonitor_alert_new_malicious_scripts scriptmonitor_alert_new_malicious_url scriptmonitor_alert_new_max_length_resource_url scriptmonitor_alert_new_resources secondary_dns_all_primaries_failing secondary_dns_primaries_failing secondary_dns_zone_successfully_updated secondary_dns_zone_validation_warning sentinel_alert stream_live_notifications tunnel_health_event tunnel_update_event universal_ssl_event_type web_analytics_metrics_update weekly_account_overview workers_alert zone_aop_custom_certificate_expiration_type], got incident_alert

│ with cloudflare_notification_policy.notification_policy,
│ on notification.tf line 32, in resource "cloudflare_notification_policy" "notification_policy":
│ 32: alert_type = "incident_alert"

Expected output

To accept the alert_type = "incident_alert" or "maintenance_event_notification" which behaviour can be seen with the RESTAPI
{
"id": "REDACTED",
"name": "Cloudflare Status\t",
"description": "Incident Alert if Cloudflare is experiencing an incident",
"enabled": true,
"alert_type": "incident_alert",
"mechanisms": {
"webhooks": [
{
"name": "slack-channel",
"id": "REDACTED"
}
]
},
"created": "REDACTED",
"modified": "REDACTED",
"conditions": {},
"filters": {
"affected_components": null,
"incident_impact": null
}
},
{
"id": "REDACTED",
"name": "Cloudflare Maintenance Notifications",
"description": "",
"enabled": true,
"alert_type": "maintenance_event_notification",

Actual output

Error: expected alert_type to be one of [access_custom_certificate_expiration_type advanced_ddos_attack_l4_alert advanced_ddos_attack_l7_alert bgp_hijack_notification billing_usage_alert block_notification_block_removed block_notification_new_block block_notification_review_rejected clickhouse_alert_fw_anomaly clickhouse_alert_fw_ent_anomaly custom_ssl_certificate_event_type dedicated_ssl_certificate_event_type dos_attack_l4 dos_attack_l7 expiring_service_token_alert failing_logpush_job_disabled_alert fbm_auto_advertisement fbm_dosd_attack fbm_volumetric_attack health_check_status_notification hostname_aop_custom_certificate_expiration_type http_alert_edge_error http_alert_origin_error load_balancing_health_alert load_balancing_pool_enablement_alert real_origin_monitoring scriptmonitor_alert_new_code_change_detections scriptmonitor_alert_new_hosts scriptmonitor_alert_new_malicious_hosts scriptmonitor_alert_new_malicious_scripts scriptmonitor_alert_new_malicious_url scriptmonitor_alert_new_max_length_resource_url scriptmonitor_alert_new_resources secondary_dns_all_primaries_failing secondary_dns_primaries_failing secondary_dns_zone_successfully_updated secondary_dns_zone_validation_warning sentinel_alert stream_live_notifications tunnel_health_event tunnel_update_event universal_ssl_event_type web_analytics_metrics_update weekly_account_overview workers_alert zone_aop_custom_certificate_expiration_type], got incident_alert

│ with cloudflare_notification_policy.notification_policy,
│ on notification.tf line 32, in resource "cloudflare_notification_policy" "notification_policy":
│ 32: alert_type = "incident_alert"


Operation failed: failed running terraform plan (exit 1)

Steps to reproduce

  1. Create the resource cloudflare_notification_policy with email or any notification type keeping alert_type as incident_alert

Additional factoids

No response

References

No response

@imadarangi imadarangi 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 Oct 25, 2023
@github-actions
Copy link
Contributor

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions
Copy link
Contributor

Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key, X-Auth-Email and Authorization HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.

This issue has been marked with triage/needs-information and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 25, 2023
@jacobbednarz jacobbednarz added kind/enhancement Categorizes issue or PR as related to improving an existing feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Oct 25, 2023
@jacobbednarz
Copy link
Member

moving to an enhancement as this is not a regression of existing functionality.

@jacobbednarz jacobbednarz removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Oct 25, 2023
@jacobbednarz
Copy link
Member

closed by #2901

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature.
Projects
None yet
Development

No branches or pull requests

2 participants