-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add r/msteams_workflow_recipient (#524)
Adds the new `r/msteams_workflow_recipient` resource, deprecates `r/msteams_recipient`, and removes the ability to create net-new instances of `r/msteams_recipient`.
- Loading branch information
Showing
14 changed files
with
258 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Resource: honeycombio_msteams_workflow_recipient | ||
|
||
`honeycombio_msteams_workflow_recipient` allows you to define and manage an MSTeams Workflows recipient that can be used by Triggers or BurnAlerts notifications. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "honeycombio_msteams_workflow_recipient" "prod" { | ||
name = "Production Alerts" | ||
url = "https://mycorp.westus.logic.azure.com/workflows/123456" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required) The name of the recipient. | ||
* `url` - (Required) The MSTeams Workflow URL to send the notification to. | ||
|
||
## Attribute Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `id` - The ID of the recipient. | ||
|
||
## Import | ||
|
||
MSTeams Workflow Recipients can be imported by their ID, e.g. | ||
|
||
``` | ||
$ terraform import honeycombio_msteams_workflow_recipient.my_recipient nx2zsefB1cX | ||
``` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package honeycombio | ||
|
||
import ( | ||
"fmt" | ||
"regexp" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
|
||
"github.com/honeycombio/terraform-provider-honeycombio/internal/helper/test" | ||
) | ||
|
||
// TestAccHoneycombMSTeamsRecipient tests the creation | ||
// and validation of the original Honeycomb MSTeams recipient | ||
// and the new Honeycomb MSTeams Workflow recipient. | ||
func TestAccHoneycombMSTeamsRecipient(t *testing.T) { | ||
t.Run("workflow recipient works", func(t *testing.T) { | ||
resource.Test(t, resource.TestCase{ | ||
PreCheck: testAccPreCheck(t), | ||
ProtoV5ProviderFactories: testAccProtoV5ProviderFactory, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: fmt.Sprintf(` | ||
resource "honeycombio_msteams_workflow_recipient" "test" { | ||
name = "%s" | ||
url = "https://example.com" | ||
}`, test.RandomStringWithPrefix("test.", 10)), | ||
}, | ||
}, | ||
}) | ||
}) | ||
|
||
t.Run("new webhook recipient fails creation", func(t *testing.T) { | ||
resource.Test(t, resource.TestCase{ | ||
PreCheck: testAccPreCheck(t), | ||
ProtoV5ProviderFactories: testAccProtoV5ProviderFactory, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: ` | ||
resource "honeycombio_msteams_recipient" "test" { | ||
name = "test" | ||
url = "https://example.com" | ||
}`, | ||
ExpectError: regexp.MustCompile(`Creating new MSTeams recipients is no longer possible`), | ||
}, | ||
}, | ||
}) | ||
}) | ||
} |
This file contains 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
Oops, something went wrong.