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

Correct type of policy_id in incoming_webhook #47

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

peter-hippo
Copy link
Contributor

According to the upstream documentation [0] and [1] the parameter for the escalation policy id shall be of type string not integer. The previous implementation could create resources fine but when running a plan of an existing resource it would fail with:

error: json: cannot unmarshal string into Go struct field incomingWebhook.data.attributes.policy_id of type int

This can easily be re-created by running terraform apply to create a incoming webhook resource with a escalation policy id and then running terraform plan as this will fail with the error message mentioned above.

[0] https://betterstack.com/docs/uptime/api/create-incoming-webhook/
[1] https://betterstack.com/docs/uptime/api/incoming-webhooks-response-params/

According to the upstream documentation [0] and [1] the parameter
for the escalation policy id shall be of type string not integer.
The previous implementation could create resources fine but when
running a plan of an existing resource it would fail with:

```
error: json: cannot unmarshal string into Go struct field incomingWebhook.data.attributes.policy_id of type int
```

This can easily be re-created by running terraform apply to create
a incoming webhook resource with a escalation policy id and then
running terraform plan as this will fail with the error message
mentioned above.

[0] https://betterstack.com/docs/uptime/api/create-incoming-webhook/
[1] https://betterstack.com/docs/uptime/api/incoming-webhooks-response-params/
@adikus adikus self-requested a review June 18, 2023 05:25
@peter-hippo
Copy link
Contributor Author

Hi @adikus , is there something I can do to get this moving? Would love to finally deploy out the managing of the incoming web hooks in our infra. 🙏

@adikus
Copy link
Contributor

adikus commented Jun 29, 2023

Thanks @peter-hippo, finally got around to testing this - works great!

@adikus adikus merged commit 460244e into BetterStackHQ:master Jun 29, 2023
4 checks passed
@adikus
Copy link
Contributor

adikus commented Jun 29, 2023

This should be released as 0.3.17 in a bit

@peter-hippo
Copy link
Contributor Author

No worries @adikus , thanks for work on the provider! 👏 ❤️

@peter-hippo peter-hippo deleted the fix-escalation-id-bug branch June 29, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants