feat(notification): add support for Telnyx notifications#371
Open
breml wants to merge 2 commits into
Open
Conversation
Add the uptimekuma_notification_telnyx resource and data source for sending SMS notifications via the Telnyx communications API. The client gained support for Telnyx in v0.4.0 (Uptime Kuma 2.3.2). Closes #347
Add `tflog.Info` after `Create` to log the assigned ID, consistent with other notification resources. Handle `kuma.ErrNotFound` in `NotificationTelnyxResource.Delete` so `terraform destroy` succeeds even when the notification was already removed in Uptime Kuma. Improve the type-mismatch error in `NotificationTelnyxDataSource` to include the actual notification type and requested ID, matching the `HaloPSA` data source pattern. Expand acceptance test assertions in both resource and data source tests to cover `is_default`, `apply_existing`, and `id`. Co-Authored-By: Lucas Bremgartner <lucas@bremis.ch>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds the
uptimekuma_notification_telnyxresource and data source for sending SMS notifications via the Telnyx communications API. The client gained support for Telnyx in v0.4.0 (Uptime Kuma 2.3.2).Changes
resource_notification_telnyx.go— model + CRUD usingnotification.Telnyx, includingImportState. The optionalmessaging_profile_idmaps to the client's*stringfield.data_source_notification_telnyx.go— lookup by ID (readByID) and by name (readByName).examples/for the resource and data source.NewNotificationTelnyxResource/NewNotificationTelnyxDataSourceinprovider.go.Attributes
api_keymessaging_profile_idphone_numberto_numberPlus the standard notification base attributes.
Follow-up fixes
tflog.InfoafterCreate, consistent with other notification resources.kuma.ErrNotFoundinDeletesoterraform destroysucceeds if the notification was already removed in Uptime Kuma.is_default,apply_existing, andid.Verification
task fmt— cleantask lint— 0 issuestask testacc— all acceptance tests pass (resource, data source, import state)task generate-docs— docs regeneratedCloses #347