Skip to content

Commit 21428eb

Browse files
Merge pull request #16 from statuspal/fix/error-when-trying-to-change-description-from-something-to-null-or-empty-string
FIX: Error when trying to change an attribute from "something" to null or empty string.
2 parents 8e6513d + 6e6db70 commit 21428eb

16 files changed

+688
-751
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes of the StatusPal Terraform provider will be documented in th
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.12] - 2024-10-17
9+
10+
### Fixed
11+
12+
- Error when trying to change an attribute from "something" to `null` or empty string.
13+
14+
### Removed
15+
16+
- `theme_configs` attribute from status page resource and data source, as it was deprecated.
17+
18+
### Added
19+
20+
- `zoom_notifications_enabled` and `allowed_email_domains` attributes to status page resource and data source.
21+
- `monitoring_options` attribute to service resource and data source.
22+
823
## [0.2.11] - 2024-10-07
924

1025
### Fixed

docs/data-sources/services.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ data "statuspal_services" "all" {
3434
<a id="nestedatt--services"></a>
3535
### Nested Schema for `services`
3636

37-
Optional:
38-
39-
- `monitoring_options` (Attributes) Configuration options for monitoring the service. These options vary depending on whether the monitoring type is internal or third-party. (see [below for nested schema](#nestedatt--services--monitoring_options))
40-
4137
Read-Only:
4238

4339
- `auto_incident` (Boolean) Create an incident automatically when this service is down and close it if/when it comes back up.
@@ -63,12 +59,13 @@ Read-Only:
6359
- `incoming_webhook_url` (String) This is field is populated from `inbound_email_id`, if the `monitoring` is set to `webhook` and the `webhook_monitoring_service` is set.
6460
- `inserted_at` (String) Datetime at which the service was inserted.
6561
- `is_up` (Boolean) Is the monitored service up?
66-
- `monitoring` (String) Enum: `null` `""` `"internal"` `"3rd_party"` `"webhook"`
62+
- `monitoring` (String) Enum: `""` `"internal"` `"3rd_party"` `"webhook"`
6763
Monitoring types:
68-
- `null` or `""` - No monitoring.
64+
- `""` - No monitoring.
6965
- `internal` - StatusPal monitoring.
7066
- `3rd_party` - 3rd Party monitoring.
7167
- `webhook` - Incoming webhook monitoring.
68+
- `monitoring_options` (Attributes) Configuration options for monitoring the service. These options vary depending on whether the monitoring type is internal or third-party. (see [below for nested schema](#nestedatt--services--monitoring_options))
7269
- `name` (String) The name of the service.
7370
- `order` (Number) Service's position in the service list.
7471
- `parent_id` (String) The service parent ID.
@@ -109,7 +106,7 @@ Read-Only:
109106
<a id="nestedatt--services--monitoring_options"></a>
110107
### Nested Schema for `services.monitoring_options`
111108

112-
Optional:
109+
Read-Only:
113110

114111
- `headers` (Attributes List) A list of header objects to be sent with the monitoring request. Each header should include a `key` and `value`. (see [below for nested schema](#nestedatt--services--monitoring_options--headers))
115112
- `keyword_down` (String) A custom keyword that indicates a 'down' status when monitoring a third-party service. This keyword is used to parse and understand service.
@@ -119,7 +116,7 @@ Optional:
119116
<a id="nestedatt--services--monitoring_options--headers"></a>
120117
### Nested Schema for `services.monitoring_options.headers`
121118

122-
Optional:
119+
Read-Only:
123120

124121
- `key` (String) The key of the header. Example: `Authorization`.
125122
- `value` (String) The value of the header. Example: `Bearer token`.

docs/data-sources/status_pages.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ data "statuspal_status_pages" "all" {
3737
Read-Only:
3838

3939
- `about` (String) Customize the about information displayed in your status page.
40-
- `allowed_email_domains` (String) Allowed email domains. Each domain should be separated by \n (e.g., 'acme.corp\nnapster.com')
40+
- `allowed_email_domains` (String) Users with these domains in their email address will be able to sign up via status page invite link. Each domain should be separated by `\n` (e.g., `acme.corp\nnapster.com`).
4141
- `bg_image` (String) Background image url of the status page.
4242
- `calendar_enabled` (Boolean) Allow your customers to receive updates via iCalendar feed.
4343
- `captcha_enabled` (Boolean) Enable captchas (this option is only available when the status page is member restricted).
@@ -101,7 +101,6 @@ Read-Only:
101101
- `subscribers_enabled` (Boolean) Allow email customers to receive email notifications.
102102
- `support_email` (String) Your company's support email.
103103
- `teams_notifications_enabled` (Boolean) Allow your customers to receive notifications on Microsoft Teams.
104-
- `theme_configs` (Object) Theme configuration for the status page. (see [below for nested schema](#nestedatt--status_pages--theme_configs))
105104
- `theme_selected` (String) The selected theme for state page, it can be "default" and "big-logo".
106105
- `time_format` (String) Display timestamps of incidents and updates in this format.
107106
- `time_zone` (String) The primary timezone the status page uses to display incidents (e.g. "Europe/Berlin").
@@ -127,22 +126,6 @@ Read-Only:
127126
- `url` (String) The website to your company, project or service.
128127
- `zoom_notifications_enabled` (Boolean) Allow your customers to receive notifications on Zoom.
129128

130-
<a id="nestedatt--status_pages--theme_configs"></a>
131-
### Nested Schema for `status_pages.theme_configs`
132-
133-
Read-Only:
134-
135-
- `header_bg_color1` (String)
136-
- `header_bg_color2` (String)
137-
- `header_fg_color` (String)
138-
- `incident_header_color` (String)
139-
- `link_color` (String)
140-
- `status_maintenance_color` (String)
141-
- `status_major_color` (String)
142-
- `status_minor_color` (String)
143-
- `status_ok_color` (String)
144-
145-
146129
<a id="nestedatt--status_pages--translations"></a>
147130
### Nested Schema for `status_pages.translations`
148131

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ terraform {
1818
required_providers {
1919
statuspal = {
2020
source = "statuspal/statuspal"
21-
version = "0.2.11"
21+
version = "0.2.12"
2222
}
2323
}
2424

docs/resources/service.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ Optional:
5757
- `description` (String) The description of the service.
5858
- `display_response_time_chart` (Boolean) Display response time chart?
5959
- `display_uptime_graph` (Boolean) Display uptime graph?
60-
- `monitoring` (String) Enum: `null` `""` `"internal"` `"3rd_party"` `"webhook"`
60+
- `monitoring` (String) Enum: `""` `"internal"` `"3rd_party"` `"webhook"`
6161
Monitoring types:
62-
- `null` or `""` - No monitoring.
62+
- `""` - No monitoring.
6363
- `internal` - StatusPal monitoring.
6464
- `3rd_party` - 3rd Party monitoring.
6565
- `webhook` - Incoming webhook monitoring.

docs/resources/status_page.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Required:
4848
Optional:
4949

5050
- `about` (String) Customize the about information displayed in your status page.
51-
- `allowed_email_domains` (String) Allowed email domains. Each domain should be separated by \n (e.g., 'acme.corp\nnapster.com')
51+
- `allowed_email_domains` (String) Users with these domains in their email address will be able to sign up via status page invite link. Each domain should be separated by `\n` (e.g., `acme.corp\nnapster.com`).
5252
- `calendar_enabled` (Boolean) Allow your customers to receive updates via iCalendar feed.
5353
- `captcha_enabled` (Boolean) Enable captchas (this option is only available when the status page is member restricted).
5454
- `current_incidents_position` (String) The incident position displayed in the status page, it can be "below_services" and "above_services".
@@ -107,7 +107,6 @@ Optional:
107107
- `subscribers_enabled` (Boolean) Allow email customers to receive email notifications.
108108
- `support_email` (String) Your company's support email.
109109
- `teams_notifications_enabled` (Boolean) Allow your customers to receive notifications on Microsoft Teams.
110-
- `theme_configs` (Object) Theme configuration for the status page. (see [below for nested schema](#nestedatt--status_page--theme_configs))
111110
- `theme_selected` (String) The selected theme for state page, it can be "default" and "big-logo".
112111
- `time_format` (String) Display timestamps of incidents and updates in this format.
113112
- `translations` (Attributes Map) A translations object. For example:
@@ -128,6 +127,7 @@ Optional:
128127
- `tweeting_enabled` (Boolean) Allows to send tweets when creating or updating an incident.
129128
- `twitter_public_screen_name` (String) Twitter handle name (e.g. yourcompany).
130129
- `uptime_graph_days` (Number) Uptime graph period.
130+
- `zoom_notifications_enabled` (Boolean) Allow your customers to receive notifications on Zoom.
131131

132132
Read-Only:
133133

@@ -136,23 +136,6 @@ Read-Only:
136136
- `inserted_at` (String) Datetime at which the status page was inserted.
137137
- `logo` (String) Logo url of the status page.
138138
- `updated_at` (String) Datetime at which the status page was last updated.
139-
- `zoom_notifications_enabled` (Boolean) Allow your customers to receive notifications on Zoom.
140-
141-
<a id="nestedatt--status_page--theme_configs"></a>
142-
### Nested Schema for `status_page.theme_configs`
143-
144-
Required:
145-
146-
- `header_bg_color1` (String)
147-
- `header_bg_color2` (String)
148-
- `header_fg_color` (String)
149-
- `incident_header_color` (String)
150-
- `link_color` (String)
151-
- `status_maintenance_color` (String)
152-
- `status_major_color` (String)
153-
- `status_minor_color` (String)
154-
- `status_ok_color` (String)
155-
156139

157140
<a id="nestedatt--status_page--translations"></a>
158141
### Nested Schema for `status_page.translations`

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
statuspal = {
55
source = "statuspal/statuspal"
6-
version = "0.2.11"
6+
version = "0.2.12"
77
}
88
}
99

internal/client/client.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ func NewClient(api_key *string, region *string, test_url *string) (*Client, erro
2626
}
2727

2828
if *region == "EU" || *region == "US" {
29-
var topLevelDomain string
30-
switch *region {
31-
case "EU":
32-
topLevelDomain = "eu"
33-
case "US":
34-
topLevelDomain = "io"
35-
}
29+
topLevelDomain := map[string]string{
30+
"EU": "eu",
31+
"US": "io",
32+
}[*region]
3633

3734
c.HostURL = fmt.Sprintf("https://statuspal.%s/api/v2", topLevelDomain)
3835
} else if env == "TEST" {

0 commit comments

Comments
 (0)