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

remove healthcheck notification properties #1789

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1789.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:breaking-change
resource/cloudflare_healthcheck: deprecates `notification_email_addresses` and `notification_suspended` in favour of `cloudflare_notification_policy`
```
2 changes: 0 additions & 2 deletions docs/resources/healthcheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ resource "cloudflare_healthcheck" "tcp_health_check" {
- `header` (Block Set) The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. (see [below for nested schema](#nestedblock--header))
- `interval` (Number) The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to `60`.
- `method` (String) The HTTP method to use for the health check. Available values: `connection_established`, `GET`, `HEAD`.
- `notification_email_addresses` (List of String, Deprecated) A list of email addresses we want to send the notifications to. Deprecated, use cloudflare_notification_policy instead.
- `notification_suspended` (Boolean, Deprecated) Whether the notifications are suspended or not. Useful for maintenance periods. Defaults to `false`.
- `path` (String) The endpoint path to health check against. Defaults to `/`.
- `port` (Number) Port number to connect to for the health check. Defaults to `80`.
- `retries` (Number) The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to `2`.
Expand Down
10 changes: 0 additions & 10 deletions internal/provider/resource_cloudflare_healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func resourceCloudflareHealthcheckRead(ctx context.Context, d *schema.ResourceDa
d.Set("expected_body", healthcheck.HTTPConfig.ExpectedBody)
d.Set("follow_redirects", healthcheck.HTTPConfig.FollowRedirects)
d.Set("allow_insecure", healthcheck.HTTPConfig.AllowInsecure)
d.Set("notification_email_addresses", healthcheck.Notification.EmailAddresses)

if err := d.Set("header", flattenHealthcheckHeader(healthcheck.HTTPConfig.Header)); err != nil {
tflog.Warn(ctx, fmt.Sprintf("Error setting header for standalone healthcheck %q: %s", d.Id(), err))
Expand All @@ -69,7 +68,6 @@ func resourceCloudflareHealthcheckRead(ctx context.Context, d *schema.ResourceDa
d.Set("name", healthcheck.Name)
d.Set("description", healthcheck.Description)
d.Set("suspended", healthcheck.Suspended)
d.Set("notification_suspended", healthcheck.Notification.Suspended)
d.Set("address", healthcheck.Address)
d.Set("consecutive_fails", healthcheck.ConsecutiveFails)
d.Set("consecutive_successes", healthcheck.ConsecutiveSuccesses)
Expand Down Expand Up @@ -186,14 +184,6 @@ func healthcheckSetStruct(d *schema.ResourceData) (cloudflare.Healthcheck, error
healthcheck.CheckRegions = expandInterfaceToStringList(region)
}

if notificationSuspended, ok := d.GetOk("notification_suspended"); ok {
healthcheck.Notification.Suspended = notificationSuspended.(bool)
}

if notificationEmailAddresses, ok := d.GetOk("notification_email_addresses"); ok {
healthcheck.Notification.EmailAddresses = expandInterfaceToStringList(notificationEmailAddresses)
}

switch healthcheck.Type {
case "TCP":
tcpConfig := new(cloudflare.HealthcheckTCPConfig)
Expand Down
16 changes: 0 additions & 16 deletions internal/provider/schema_cloudflare_healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,6 @@ func resourceCloudflareHealthcheckSchema() map[string]*schema.Schema {
},
},
},
"notification_suspended": {
Description: "Whether the notifications are suspended or not. Useful for maintenance periods.",
Type: schema.TypeBool,
Optional: true,
Default: false,
Deprecated: "Use `cloudflare_notification_policy` instead.",
},
"notification_email_addresses": {
Description: "A list of email addresses we want to send the notifications to. Deprecated, use cloudflare_notification_policy instead.",
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Deprecated: "Use `cloudflare_notification_policy` instead.",
},
"created_on": {
Description: "Creation time.",
Type: schema.TypeString,
Expand Down