Repository: honeycombio/terraform-provider-honeycombio (language: python)

Issue:
Add Sweepers for test cleanup
The test suite is still leaving many things behind after a test run: notably Recipients even after a fully successful run. This gets extra sticky if a test run is unable to clean up (panic, cancelled early) and dangling resources end up causing conflicts on the following test runs.

Implementing [Sweepers](https://developer.hashicorp.com/terraform/plugin/testing/acceptance-tests/sweepers) may help ease the pain here, especially if the entire test suite ends up prefixing resources with `test-` or `test.` or some such thing.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index cc8c1fe7..4b9a8cd7 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -84,6 +84,16 @@ jobs:
           TF_ACC_TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }}
         run: go test -v -coverprofile=tf-coverage.txt -covermode=atomic ./internal/... ./honeycombio/...
 
+      - name: Cleanup Dangling Resources
+        if: ${{ always() }}
+        timeout-minutes: 5
+        env:
+          HONEYCOMB_API_KEY: ${{ secrets.HONEYCOMB_API_KEY }}
+          HONEYCOMB_KEY_ID: ${{ secrets.HONEYCOMB_KEY_ID }}
+          HONEYCOMB_KEY_SECRET: ${{ secrets.HONEYCOMB_KEY_SECRET }}
+          HONEYCOMB_DATASET: testacc
+        run: make sweep
+
       - name: Generate Coverage Report
         uses: codecov/codecov-action@v4.5.0
         with:
@@ -142,6 +152,17 @@ jobs:
           TF_ACC_TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }}
         run: go test -v -coverprofile=tf-coverage.txt -covermode=atomic ./internal/... ./honeycombio/...
 
+      - name: Cleanup Dangling Resources
+        if: ${{ always() }}
+        timeout-minutes: 5
+        env:
+          HONEYCOMB_API_ENDPOINT: https://api.eu1.honeycomb.io
+          HONEYCOMB_API_KEY: ${{ secrets.HONEYCOMB_API_KEY_EU }}
+          HONEYCOMB_KEY_ID: ${{ secrets.HONEYCOMB_KEY_ID_EU }}
+          HONEYCOMB_KEY_SECRET: ${{ secrets.HONEYCOMB_KEY_SECRET_EU }}
+          HONEYCOMB_DATASET: testacc
+        run: make sweep
+
       - name: Generate Coverage Report
         uses: codecov/codecov-action@v4.5.0
         with:
diff --git a/.golangci.yml b/.golangci.yml
index d9c9c5b8..18adb06b 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -35,7 +35,7 @@ linters:
         - unconvert
         - unparam
         - unused
-        - vet
+        - govet
 
 run:
     # Prevent false positive timeouts in CI
diff --git a/Makefile b/Makefile
index 1c3781b6..ef113018 100644
--- a/Makefile
+++ b/Makefile
@@ -1,32 +1,17 @@
+.PHONY: build testacc lint sweep
+default: testacc
+
 build:
 	go build -o terraform-provider-honeycombio
 
 testacc:
 	TF_ACC=1 go test -v ./...
 
-fmt:
-	goimports -l -w .
-	go mod tidy
-	terraform fmt --recursive
-
-# Terraform 0.13+ only: build the repository and install the provider in one of
-# the local mirror directories following the new fileystem layout. Additionally,
-# we have to specify a version.
-#
-# https://www.terraform.io/docs/commands/cli-config.html#implied-local-mirror-directories
-# https://www.terraform.io/upgrade-guides/0-13.html#new-filesystem-layout-for-local-copies-of-providers
-
-version = 99.0.0
-os_arch = $(shell go env GOOS)_$(shell go env GOARCH)
-provider_path = registry.terraform.io/honeycombio/honeycombio/$(version)/$(os_arch)/
-
-install_macos:
-	go build -o terraform-provider-honeycombio_$(version)
-
-	mkdir -p ~/Library/Application\ Support/io.terraform/plugins/$(provider_path)
-	cp terraform-provider-honeycombio_$(version)  ~/Library/Application\ Support/io.terraform/plugins/$(provider_path)
+lint:
+	golangci-lint run
 
-uninstall_macos:
-	rm -r ~/Library/Application\ Support/io.terraform/plugins/registry.terraform.io/honeycombio
+sweep:
+# the sweep flag requires a string to be passed, but it is not used
+	@echo "WARNING: This will destroy resources. Use only in development teams."
+	go test ./internal/provider -v -timeout 5m -sweep=env
 
-.PHONY: build testacc install


Test patch:
diff --git a/client/burn_alert_test.go b/client/burn_alert_test.go
index bfa983f4..ff215377 100644
--- a/client/burn_alert_test.go
+++ b/client/burn_alert_test.go
@@ -21,7 +21,7 @@ func TestBurnAlerts(t *testing.T) {
 
 	c := newTestClient(t)
 	dataset := testDataset(t)
-	testAlertEmail := test.RandomString(8) + "@example.com"
+	testAlertEmail := test.RandomEmail()
 
 	sli, err := c.DerivedColumns.Create(ctx, dataset, &client.DerivedColumn{
 		Alias:      test.RandomStringWithPrefix("test.", 8),
diff --git a/client/query_annotation_test.go b/client/query_annotation_test.go
index f36dc572..1a3b800d 100644
--- a/client/query_annotation_test.go
+++ b/client/query_annotation_test.go
@@ -8,6 +8,7 @@ import (
 	"github.com/stretchr/testify/require"
 
 	"github.com/honeycombio/terraform-provider-honeycombio/client"
+	"github.com/honeycombio/terraform-provider-honeycombio/internal/helper/test"
 )
 
 func TestQueryAnnotations(t *testing.T) {
@@ -33,7 +34,7 @@ func TestQueryAnnotations(t *testing.T) {
 
 	t.Run("Create", func(t *testing.T) {
 		data := &client.QueryAnnotation{
-			Name:        "Query created by a test",
+			Name:        test.RandomStringWithPrefix("test.", 20),
 			Description: "This derived column is created by a test",
 			QueryID:     *query.ID,
 		}
@@ -62,7 +63,7 @@ func TestQueryAnnotations(t *testing.T) {
 		// change all the fields to test
 		data := &client.QueryAnnotation{
 			ID:          queryAnnotation.ID,
-			Name:        "This is a new name for the query created by a test",
+			Name:        test.RandomStringWithPrefix("test.", 20),
 			Description: "This is a new description",
 			QueryID:     *query.ID,
 		}
diff --git a/client/recipient_test.go b/client/recipient_test.go
index 319ceb53..eecd1d4e 100644
--- a/client/recipient_test.go
+++ b/client/recipient_test.go
@@ -26,7 +26,7 @@ func TestRecipientsEmail(t *testing.T) {
 		data := &client.Recipient{
 			Type: client.RecipientTypeEmail,
 			Details: client.RecipientDetails{
-				EmailAddress: test.RandomString(8) + "@example.com",
+				EmailAddress: test.RandomEmail(),
 			},
 		}
 		now := time.Now()
@@ -56,7 +56,7 @@ func TestRecipientsEmail(t *testing.T) {
 	})
 
 	t.Run("Update", func(t *testing.T) {
-		rcpt.Details.EmailAddress = "hnytest2@example.com"
+		rcpt.Details.EmailAddress = test.RandomEmail()
 		now := time.Now()
 		result, err := c.Recipients.Update(ctx, rcpt)
 
diff --git a/client/v2/api_keys_test.go b/client/v2/api_keys_test.go
index 8df805e6..04f4b473 100644
--- a/client/v2/api_keys_test.go
+++ b/client/v2/api_keys_test.go
@@ -12,6 +12,7 @@ import (
 
 	hnyclient "github.com/honeycombio/terraform-provider-honeycombio/client"
 	"github.com/honeycombio/terraform-provider-honeycombio/internal/helper"
+	"github.com/honeycombio/terraform-provider-honeycombio/internal/helper/test"
 )
 
 func TestClient_APIKeys(t *testing.T) {
@@ -20,8 +21,9 @@ func TestClient_APIKeys(t *testing.T) {
 	env := newTestEnvironment(ctx, t, c)
 
 	// create a new key
+	keyName := test.RandomStringWithPrefix("test.", 10)
 	k, err := c.APIKeys.Create(ctx, &APIKey{
-		Name:    helper.ToPtr("test key"),
+		Name:    helper.ToPtr(keyName),
 		KeyType: "ingest",
 		Environment: &Environment{
 			ID: env.ID,
@@ -33,7 +35,7 @@ func TestClient_APIKeys(t *testing.T) {
 	require.NoError(t, err)
 	assert.NotEmpty(t, k.ID)
 	assert.NotEmpty(t, k.Secret)
-	assert.Equal(t, "test key", *k.Name)
+	assert.Equal(t, keyName, *k.Name)
 	assert.False(t, *k.Disabled)
 	assert.True(t, k.Permissions.CreateDatasets)
 
@@ -50,14 +52,15 @@ func TestClient_APIKeys(t *testing.T) {
 	assert.WithinDuration(t, k.Timestamps.UpdatedAt, key.Timestamps.UpdatedAt, 5*time.Second)
 
 	// update the key's name and disable it
+	keyName = test.RandomStringWithPrefix("test.", 10)
 	key, err = c.APIKeys.Update(ctx, &APIKey{
 		ID:       k.ID,
-		Name:     helper.ToPtr("new name"),
+		Name:     helper.ToPtr(keyName),
 		Disabled: helper.ToPtr(true),
 	})
 	require.NoError(t, err)
 	assert.Equal(t, k.ID, key.ID)
-	assert.Equal(t, "new name", *key.Name)
+	assert.Equal(t, keyName, *key.Name)
 	assert.True(t, *key.Disabled)
 	assert.WithinDuration(t, time.Now(), key.Timestamps.UpdatedAt, time.Second)
 
diff --git a/honeycombio/data_source_recipient_test.go b/honeycombio/data_source_recipient_test.go
index 9b31aa0f..7f3ec9d4 100644
--- a/honeycombio/data_source_recipient_test.go
+++ b/honeycombio/data_source_recipient_test.go
@@ -11,6 +11,7 @@ import (
 	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
 
 	honeycombio "github.com/honeycombio/terraform-provider-honeycombio/client"
+	"github.com/honeycombio/terraform-provider-honeycombio/internal/helper/test"
 )
 
 func TestAccDataSourceHoneycombioRecipient_basic(t *testing.T) {
@@ -21,53 +22,53 @@ func TestAccDataSourceHoneycombioRecipient_basic(t *testing.T) {
 		{
 			Type: honeycombio.RecipientTypeEmail,
 			Details: honeycombio.RecipientDetails{
-				EmailAddress: "acctest@example.org",
+				EmailAddress: test.RandomEmail(),
 			},
 		},
 		{
 			Type: honeycombio.RecipientTypeEmail,
 			Details: honeycombio.RecipientDetails{
-				EmailAddress: "acctest2@example.org",
+				EmailAddress: test.RandomEmail(),
 			},
 		},
 		{
 			Type: honeycombio.RecipientTypeSlack,
 			Details: honeycombio.RecipientDetails{
-				SlackChannel: "#acctest",
+				SlackChannel: test.RandomStringWithPrefix("#test.", 12),
 			},
 		},
 		{
 			Type: honeycombio.RecipientTypeSlack,
 			Details: honeycombio.RecipientDetails{
-				SlackChannel: "#tmp-acctest",
+				SlackChannel: test.RandomStringWithPrefix("#test.", 12),
 			},
 		},
 		{
 			Type: honeycombio.RecipientTypePagerDuty,
 			Details: honeycombio.RecipientDetails{
-				PDIntegrationKey:  "6f05176bf1c7a1adb6ee516521770ec4",
-				PDIntegrationName: "My Important Service",
+				PDIntegrationKey:  test.RandomString(32),
+				PDIntegrationName: test.RandomStringWithPrefix("test.", 20),
 			},
 		},
 		{
 			Type: honeycombio.RecipientTypePagerDuty,
 			Details: honeycombio.RecipientDetails{
-				PDIntegrationKey:  "6f05176bf1b7a1adb6ee516521770ac0",
-				PDIntegrationName: "My Other Important Service",
+				PDIntegrationKey:  test.RandomString(32),
+				PDIntegrationName: test.RandomStringWithPrefix("test.", 20),
 			},
 		},
 		{
 			Type: honeycombio.RecipientTypeWebhook,
 			Details: honeycombio.RecipientDetails{
-				WebhookName:   "My Notifications Hook",
-				WebhookSecret: "s0s3kret!",
+				WebhookName:   test.RandomStringWithPrefix("test.", 16),
+				WebhookSecret: test.RandomString(20),
 				WebhookURL:    "https://my.webhook.dev.corp.io",
 			},
 		},
 		{
 			Type: honeycombio.RecipientTypeMSTeams,
 			Details: honeycombio.RecipientDetails{
-				WebhookName: "My Teams Channel",
+				WebhookName: test.RandomStringWithPrefix("test.", 16),
 				WebhookURL:  "https://outlook.office.com/webhook/12345",
 			},
 		},
@@ -92,57 +93,57 @@ func TestAccDataSourceHoneycombioRecipient_basic(t *testing.T) {
 		ProtoV5ProviderFactories: testAccProtoV5ProviderFactory,
 		Steps: []resource.TestStep{
 			{
-				Config: testAccRecipientWithDeprecatedTarget("email", "acctest@example.org"),
-				Check:  resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "address", "acctest@example.org"),
+				Config: testAccRecipientWithDeprecatedTarget("email", testRecipients[0].Details.EmailAddress),
+				Check:  resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "address", testRecipients[0].Details.EmailAddress),
 			},
 			{
-				Config: testAccRecipientWithDeprecatedTarget("slack", "#acctest"),
-				Check:  resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "channel", "#acctest"),
+				Config: testAccRecipientWithDeprecatedTarget("slack", testRecipients[2].Details.SlackChannel),
+				Check:  resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "channel", testRecipients[2].Details.SlackChannel),
 			},
 			{
 				Config:      testAccRecipientWithDeprecatedTarget("email", "another@example.org"),
 				ExpectError: regexp.MustCompile("your recipient query returned no results."),
 			},
 			{
-				Config: testAccRecipientWithFilterValue("email", "address", "acctest2@example.org"),
-				Check:  resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "address", "acctest2@example.org"),
+				Config: testAccRecipientWithFilterValue("email", "address", testRecipients[1].Details.EmailAddress),
+				Check:  resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "address", testRecipients[1].Details.EmailAddress),
 			},
 			{
 				Config:      testAccRecipientWithFilterValue("email", "address", "another@example.org"),
 				ExpectError: regexp.MustCompile("your recipient query returned no results."),
 			},
 			{
-				Config: testAccRecipientWithFilterValue("pagerduty", "integration_name", "My Important Service"),
+				Config: testAccRecipientWithFilterValue("pagerduty", "integration_name", testRecipients[4].Details.PDIntegrationName),
 				Check: resource.ComposeAggregateTestCheckFunc(
-					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "integration_name", "My Important Service"),
-					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "integration_key", "6f05176bf1c7a1adb6ee516521770ec4"),
+					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "integration_name", testRecipients[4].Details.PDIntegrationName),
+					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "integration_key", testRecipients[4].Details.PDIntegrationKey),
 				),
 			},
 			{
 				Config: testAccRecipientWithFilterRegex("webhook", "url", ".*dev.corp.io"),
 				Check: resource.ComposeAggregateTestCheckFunc(
-					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "name", "My Notifications Hook"),
-					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "secret", "s0s3kret!"),
+					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "name", testRecipients[6].Details.WebhookName),
+					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "secret", testRecipients[6].Details.WebhookSecret),
 					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "url", "https://my.webhook.dev.corp.io"),
 				),
 			},
 			{
-				Config: testAccRecipientWithFilterValue("msteams", "name", "My Teams Channel"),
+				Config: testAccRecipientWithFilterValue("msteams", "name", testRecipients[7].Details.WebhookName),
 				Check: resource.ComposeAggregateTestCheckFunc(
-					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "name", "My Teams Channel"),
+					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "name", testRecipients[7].Details.WebhookName),
 					resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "url", "https://outlook.office.com/webhook/12345"),
 				),
 			},
 			{
-				Config: testAccRecipientWithFilterValue("slack", "channel", "#tmp-acctest"),
-				Check:  resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "channel", "#tmp-acctest"),
+				Config: testAccRecipientWithFilterValue("slack", "channel", testRecipients[3].Details.SlackChannel),
+				Check:  resource.TestCheckResourceAttr("data.honeycombio_recipient.test", "channel", testRecipients[3].Details.SlackChannel),
 			},
 			{
-				Config:      testAccRecipientWithFilterRegex("email", "address", "^acctest*"),
+				Config:      testAccRecipientWithFilterRegex("email", "address", ".*@example.com"),
 				ExpectError: regexp.MustCompile("your recipient query returned more than one result. Please try a more specific search criteria."),
 			},
 			{
-				Config:      testAccRecipientWithFilterRegex("pagerduty", "integration_name", "^.*Important Service$"),
+				Config:      testAccRecipientWithFilterRegex("pagerduty", "integration_name", ".*"),
 				ExpectError: regexp.MustCompile("your recipient query returned more than one result. Please try a more specific search criteria."),
 			},
 		},
@@ -154,8 +155,7 @@ func testAccRecipientWithDeprecatedTarget(recipientType, target string) string {
 data "honeycombio_recipient" "test" {
   type   = "%s"
   target = "%s"
-}
-`, recipientType, target)
+}`, recipientType, target)
 }
 
 func testAccRecipientWithFilterValue(recipientType, filterName, filterValue string) string {
@@ -167,8 +167,7 @@ data "honeycombio_recipient" "test" {
     name  = "%s"
     value = "%s"
   }
-}
-`, recipientType, filterName, filterValue)
+}`, recipientType, filterName, filterValue)
 }
 
 func testAccRecipientWithFilterRegex(recipientType, filterName, filterRegex string) string {
@@ -180,6 +179,5 @@ data "honeycombio_recipient" "test" {
     name        = "%s"
     value_regex = "%s"
   }
-}
-`, recipientType, filterName, filterRegex)
+}`, recipientType, filterName, filterRegex)
 }
diff --git a/honeycombio/data_source_trigger_recipient_test.go b/honeycombio/data_source_trigger_recipient_test.go
index 41cda1dd..2baa0100 100644
--- a/honeycombio/data_source_trigger_recipient_test.go
+++ b/honeycombio/data_source_trigger_recipient_test.go
@@ -11,6 +11,7 @@ import (
 	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
 
 	honeycombio "github.com/honeycombio/terraform-provider-honeycombio/client"
+	"github.com/honeycombio/terraform-provider-honeycombio/internal/helper/test"
 )
 
 func TestAccDataSourceHoneycombioTriggerRecipient_basic(t *testing.T) {
@@ -18,8 +19,9 @@ func TestAccDataSourceHoneycombioTriggerRecipient_basic(t *testing.T) {
 	dataset := testAccDataset()
 	c := testAccClient(t)
 
+	randomEmail := test.RandomEmail()
 	trigger, err := c.Triggers.Create(ctx, dataset, &honeycombio.Trigger{
-		Name: "test trigger",
+		Name: test.RandomStringWithPrefix("test.", 12),
 		Query: &honeycombio.QuerySpec{
 			Calculations: []honeycombio.CalculationSpec{
 				{Op: honeycombio.CalculationOpCount},
@@ -32,7 +34,7 @@ func TestAccDataSourceHoneycombioTriggerRecipient_basic(t *testing.T) {
 		Recipients: []honeycombio.NotificationRecipient{
 			{
 				Type:   honeycombio.RecipientTypeEmail,
-				Target: "acctest@example.com",
+				Target: randomEmail,
 			},
 		},
 	})
@@ -47,11 +49,11 @@ func TestAccDataSourceHoneycombioTriggerRecipient_basic(t *testing.T) {
 		ProtoV5ProviderFactories: testAccProtoV5ProviderFactory,
 		Steps: []resource.TestStep{
 			{
-				Config: testAccTriggerRecipient(dataset, "email", "acctest@example.com"),
+				Config: testAccTriggerRecipient(dataset, "email", randomEmail),
 			},
 			{
-				Config:      testAccTriggerRecipient(dataset, "email", "another@example.com"),
-				ExpectError: regexp.MustCompile("could not find a trigger recipient in .* with type = \"email\" and target = \"another@example.com\""),
+				Config:      testAccTriggerRecipient(dataset, "email", "random@corp.net"),
+				ExpectError: regexp.MustCompile("could not find a trigger recipient in .* with type = \"email\" and target = \"random@corp.net\""),
 			},
 			{
 				Config:      testAccTriggerRecipient(dataset, "slack", "honeycombio"),
diff --git a/honeycombio/resource_recipients_test.go b/honeycombio/resource_recipients_test.go
deleted file mode 100644
index 88a42012..00000000
--- a/honeycombio/resource_recipients_test.go
+++ /dev/null
@@ -1,99 +0,0 @@
-package honeycombio
-
-import (
-	"context"
-	"fmt"
-	"testing"
-
-	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
-	"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
-)
-
-func TestAccHoneycombioRecipients_basic(t *testing.T) {
-	resource.Test(t, resource.TestCase{
-		PreCheck:                 testAccPreCheck(t),
-		ProtoV5ProviderFactories: testAccProtoV5ProviderFactory,
-		Steps: []resource.TestStep{
-			{
-				Config: `
-resource "honeycombio_email_recipient" "test" {
-  address = "tf-test@example.com"
-}
-`,
-				Check: resource.ComposeTestCheckFunc(
-					testAccCheckRecipientExists(t, "honeycombio_email_recipient.test"),
-					resource.TestCheckResourceAttr("honeycombio_email_recipient.test", "address", "tf-test@example.com"),
-				),
-			},
-			{
-				Config: `
-resource "honeycombio_slack_recipient" "test" {
-  channel = "#alerty-alerts"
-}
-`,
-				Check: resource.ComposeTestCheckFunc(
-					testAccCheckRecipientExists(t, "honeycombio_slack_recipient.test"),
-					resource.TestCheckResourceAttr("honeycombio_slack_recipient.test", "channel", "#alerty-alerts"),
-				),
-			},
-			{
-				Config: `
-resource "honeycombio_pagerduty_recipient" "test" {
-  integration_key  = "cd6e8de3c857aefc950e0d5ebcb79ac2"
-  integration_name = "myservice-notifications"
-}
-`,
-				Check: resource.ComposeTestCheckFunc(
-					testAccCheckRecipientExists(t, "honeycombio_pagerduty_recipient.test"),
-					resource.TestCheckResourceAttr("honeycombio_pagerduty_recipient.test", "integration_key", "cd6e8de3c857aefc950e0d5ebcb79ac2"),
-					resource.TestCheckResourceAttr("honeycombio_pagerduty_recipient.test", "integration_name", "myservice-notifications"),
-				),
-			},
-			{
-				Config: `
-resource "honeycombio_webhook_recipient" "test" {
-  name    = "custom-alert-router"
-  secret  = "s0s3kr3t!"
-  url     = "https://my.url.corp.net"
-}
-`,
-				Check: resource.ComposeTestCheckFunc(
-					testAccCheckRecipientExists(t, "honeycombio_webhook_recipient.test"),
-					resource.TestCheckResourceAttr("honeycombio_webhook_recipient.test", "name", "custom-alert-router"),
-					resource.TestCheckResourceAttr("honeycombio_webhook_recipient.test", "secret", "s0s3kr3t!"),
-					resource.TestCheckResourceAttr("honeycombio_webhook_recipient.test", "url", "https://my.url.corp.net"),
-				),
-			},
-			{
-				Config: `
-			resource "honeycombio_msteams_recipient" "test" {
-			  name = "my teams channel"
-			  url  = "https://my.url.office.com/webhooks/incoming/123456789/abcdefg"
-			}
-			`,
-				Check: resource.ComposeTestCheckFunc(
-					testAccCheckRecipientExists(t, "honeycombio_msteams_recipient.test"),
-					resource.TestCheckResourceAttr("honeycombio_msteams_recipient.test", "name", "my teams channel"),
-					resource.TestCheckResourceAttr("honeycombio_msteams_recipient.test", "url", "https://my.url.office.com/webhooks/incoming/123456789/abcdefg"),
-				),
-			},
-		},
-	})
-}
-
-func testAccCheckRecipientExists(t *testing.T, resourceName string) resource.TestCheckFunc {
-	return func(s *terraform.State) error {
-		resourceState, ok := s.RootModule().Resources[resourceName]
-		if !ok {
-			return fmt.Errorf("not found: %s", resourceName)
-		}
-
-		client := testAccClient(t)
-		_, err := client.Recipients.Get(context.Background(), resourceState.Primary.ID)
-		if err != nil {
-			return fmt.Errorf("could not find created Recipient: %w", err)
-		}
-
-		return nil
-	}
-}
diff --git a/internal/helper/test/strings.go b/internal/helper/test/strings.go
index 04bed56b..ad604449 100644
--- a/internal/helper/test/strings.go
+++ b/internal/helper/test/strings.go
@@ -23,11 +23,17 @@ func RandomString(length int) string {
 //
 // Example:
 //
-//	RandomStringWithPrefix("test-", 10) => "test-abcde12345"
+//	RandomStringWithPrefix("test.", 10) => "test.abcde12345"
 func RandomStringWithPrefix(prefix string, length int) string {
 	return prefix + RandomString(length)
 }
 
+// RandomEmail generates a random email address for testing purposes
+// in the "@example.com" domain.
+func RandomEmail() string {
+	return RandomStringWithPrefix("test.", 10) + "@example.com"
+}
+
 // MinifyJSON minifies a JSON string removing all whitespace and newlines
 func MinifyJSON(s string) (string, error) {
 	var buffer bytes.Buffer
diff --git a/internal/provider/burn_alert_resource_test.go b/internal/provider/burn_alert_resource_test.go
index effa9e6b..e0326e63 100644
--- a/internal/provider/burn_alert_resource_test.go
+++ b/internal/provider/burn_alert_resource_test.go
@@ -14,6 +14,7 @@ import (
 	"github.com/stretchr/testify/require"
 
 	"github.com/honeycombio/terraform-provider-honeycombio/internal/helper"
+	"github.com/honeycombio/terraform-provider-honeycombio/internal/helper/test"
 
 	"github.com/honeycombio/terraform-provider-honeycombio/client"
 )
@@ -427,7 +428,7 @@ func TestAcc_BurnAlertResource_HandlesRecipientChangedOutsideOfTerraform(t *test
 	dataset, sloID := burnAlertAccTestSetup(t)
 
 	// setup a slack recipient to be used in the burn alert, and modified outside of terraform
-	channel := "#" + acctest.RandString(8)
+	channel := test.RandomStringWithPrefix("#test.", 8)
 	rcpt, err := c.Recipients.Create(ctx, &client.Recipient{
 		Type: client.RecipientTypeSlack,
 		Details: client.RecipientDetails{
@@ -653,7 +654,7 @@ func testAccConfigBurnAlertDefault_basic(exhaustionMinutes int, dataset, sloID,
 	return fmt.Sprintf(`
 resource "honeycombio_pagerduty_recipient" "test" {
   integration_key  = "08b9d4cacd68933151a1ef1028b67da2"
-  integration_name = "testacc-basic"
+  integration_name = "test.pd-basic"
 }
 
 resource "honeycombio_burn_alert" "test" {
@@ -683,16 +684,16 @@ resource "honeycombio_burn_alert" "test" {
 
   recipient {
     type   = "email"
-    target = "test@example.com"
+    target = "%s[3]s"
   }
-}`, dataset, sloID)
+}`, dataset, sloID, test.RandomEmail())
 }
 
 func testAccConfigBurnAlertExhaustionTime_basic(exhaustionMinutes int, dataset, sloID, pdseverity string) string {
 	return fmt.Sprintf(`
 resource "honeycombio_pagerduty_recipient" "test" {
   integration_key  = "08b9d4cacd68933151a1ef1028b67da2"
-  integration_name = "testacc-basic"
+  integration_name = "test.pd-basic"
 }
 
 resource "honeycombio_burn_alert" "test" {
@@ -724,16 +725,16 @@ resource "honeycombio_burn_alert" "test" {
 
   recipient {
     type   = "email"
-    target = "test@example.com"
+    target = "%[3]s"
   }
-}`, dataset, sloID)
+}`, dataset, sloID, test.RandomEmail())
 }
 
 func testAccConfigBurnAlertBudgetRate_basic(budgetRateWindowMinutes int, budgetRateDecreasePercent float64, dataset, sloID, pdseverity string) string {
 	return fmt.Sprintf(`
 resource "honeycombio_pagerduty_recipient" "test" {
   integration_key  = "08b9d4cacd68933151a1ef1028b67da2"
-  integration_name = "testacc-basic"
+  integration_name = "test.pd-basic"
 }
 
 resource "honeycombio_burn_alert" "test" {
@@ -758,7 +759,7 @@ func testAccConfigBurnAlertBudgetRate_trailingZeros(dataset, sloID string) strin
 	return fmt.Sprintf(`
 resource "honeycombio_pagerduty_recipient" "test" {
   integration_key  = "08b9d4cacd68933151a1ef1028b67da2"
-  integration_name = "testacc-basic"
+  integration_name = "test.pd-basic"
 }
 
 resource "honeycombio_burn_alert" "test" {
@@ -790,9 +791,9 @@ resource "honeycombio_burn_alert" "test" {
 
   recipient {
     type   = "email"
-    target = "test@example.com"
+    target = "%[3]s"
   }
-}`, dataset, sloID)
+}`, dataset, sloID, test.RandomEmail())
 }
 
 func testAccConfigBurnAlertBudgetRate_validateUnknownOrVariableAttributesWhenAlertTypeIsExhaustionTime(dataset, sloID string) string {
@@ -804,7 +805,7 @@ variable "exhaustion_minutes" {
 
 resource "honeycombio_pagerduty_recipient" "test" {
   integration_key  = "08b9d4cacd68933151a1ef1028b67da2"
-  integration_name = "testacc-basic"
+  integration_name = "test.pd-basic"
 }
 
 resource "honeycombio_burn_alert" "test" {
@@ -840,23 +841,22 @@ resource "honeycombio_burn_alert" "test" {
 
 func testAccConfigBurnAlertWithDynamicRecipient(dataset, sloID string) string {
 	return fmt.Sprintf(`
-
 variable "recipients" {
-	type = list(object({
-		type   = string
-		target = string
-		}))
-
-	default = [
-		{
-			"type": "email",
-			"target": "test1@example.com"
-		},
-		{
-			"type": "email",
-			"target": "test2@example.com"
-		}
-	]
+  type = list(object({
+    type   = string
+    target = string
+  }))
+
+  default = [
+    {
+      "type": "email",
+      "target": "%[3]s"
+    },
+    {
+      "type": "email",
+      "target": "%[4]s"
+    }
+  ]
 }
 
 resource "honeycombio_burn_alert" "test" {
@@ -866,12 +866,12 @@ resource "honeycombio_burn_alert" "test" {
   slo_id  = "%[2]s"
 
   dynamic "recipient" {
-	for_each = var.recipients
+    for_each = var.recipients
 
-	content {
-		type   = recipient.value.type
-    	target = recipient.value.target
-	}
+    content {
+      type   = recipient.value.type
+      target = recipient.value.target
+    }
   }
-}`, dataset, sloID)
+}`, dataset, sloID, test.RandomEmail(), test.RandomEmail())
 }
diff --git a/internal/provider/honeycombio_sweeper_test.go b/internal/provider/honeycombio_sweeper_test.go
new file mode 100644
index 00000000..2810dd53
--- /dev/null
+++ b/internal/provider/honeycombio_sweeper_test.go
@@ -0,0 +1,70 @@
+package provider
+
+import (
+	"context"
+	"fmt"
+	"log"
+	"strings"
+	"testing"
+
+	"github.com/hashicorp/terraform-plugin-testing/helper/resource"
+
+	"github.com/honeycombio/terraform-provider-honeycombio/client"
+)
+
+// TestMain is responsible for parsing the special test flags and invoking the sweepers
+//
+//	See: https://developer.hashicorp.com/terraform/plugin/testing/acceptance-tests/sweepers
+func TestMain(m *testing.M) {
+	resource.TestMain(m)
+}
+
+func init() {
+	resource.AddTestSweepers("recipients", getRecipientSweeper("recipients"))
+}
+
+// getRecipientSweeper returns a Sweeper that deletes recipients with names
+// starting with "test." or "#test."
+func getRecipientSweeper(name string) *resource.Sweeper {
+	return &resource.Sweeper{
+		Name: name,
+		F: func(_ string) error {
+			ctx := context.Background()
+			c, err := client.NewClient()
+			if err != nil {
+				return fmt.Errorf("could not initialize client: %w", err)
+			}
+			rcpts, err := c.Recipients.List(ctx)
+			if err != nil {
+				return fmt.Errorf("could not list recipients: %w", err)
+			}
+
+			var name string
+			for _, r := range rcpts {
+				switch r.Type {
+				case client.RecipientTypeEmail:
+					name = r.Details.EmailAddress
+				case client.RecipientTypeSlack:
+					name = r.Details.SlackChannel
+				case client.RecipientTypePagerDuty:
+					name = r.Details.PDIntegrationName
+				case client.RecipientTypeWebhook, client.RecipientTypeMSTeams:
+					name = r.Details.WebhookName
+				default:
+					log.Printf("[ERROR] unknown recipient type: %s", r.Type)
+					continue
+				}
+
+				if strings.HasPrefix(name, "test.") || strings.HasPrefix(name, "#test.") {
+					log.Printf("[DEBUG] deleting %s recipient \"%s\" (%s)", r.Type, name, r.ID)
+					err = c.Recipients.Delete(ctx, r.ID)
+					if err != nil {
+						log.Printf("[ERROR] could not delete %s recipient %s: %s", r.Type, r.ID, err)
+					}
+				}
+			}
+
+			return nil
+		},
+	}
+}
diff --git a/internal/provider/query_resource_test.go b/internal/provider/query_resource_test.go
index 41e267fe..8fcef584 100644
--- a/internal/provider/query_resource_test.go
+++ b/internal/provider/query_resource_test.go
@@ -20,7 +20,7 @@ func TestAcc_QueryResource(t *testing.T) {
 	dataset := testAccDataset()
 	c := testAccClient(t)
 	col, err := c.Columns.Create(ctx, dataset, &client.Column{
-		KeyName: test.RandomStringWithPrefix("test-", 10),
+		KeyName: test.RandomStringWithPrefix("test.", 10),
 		Type:    client.ToPtr(client.ColumnTypeFloat),
 	})
 	require.NoError(t, err)
@@ -108,7 +108,7 @@ func TestAcc_QueryResourceUpgradeFromVersion022(t *testing.T) {
 	dataset := testAccDataset()
 	c := testAccClient(t)
 	col, err := c.Columns.Create(ctx, dataset, &client.Column{
-		KeyName: test.RandomStringWithPrefix("test-", 10),
+		KeyName: test.RandomStringWithPrefix("test.", 10),
 		Type:    client.ToPtr(client.ColumnTypeFloat),
 	})
 	require.NoError(t, err)
diff --git a/internal/provider/trigger_resource_test.go b/internal/provider/trigger_resource_test.go
index ae600bc1..3b566f8a 100644
--- a/internal/provider/trigger_resource_test.go
+++ b/internal/provider/trigger_resource_test.go
@@ -9,15 +9,16 @@ import (
 
 	"github.com/stretchr/testify/require"
 
-	"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
 	"github.com/hashicorp/terraform-plugin-testing/helper/resource"
 	"github.com/hashicorp/terraform-plugin-testing/terraform"
 
 	"github.com/honeycombio/terraform-provider-honeycombio/client"
+	"github.com/honeycombio/terraform-provider-honeycombio/internal/helper/test"
 )
 
 func TestAcc_TriggerResource(t *testing.T) {
 	dataset := testAccDataset()
+	name := test.RandomStringWithPrefix("test.", 20)
 
 	t.Run("trigger resource with Query ID", func(t *testing.T) {
 		resource.Test(t, resource.TestCase{
@@ -25,10 +26,10 @@ func TestAcc_TriggerResource(t *testing.T) {
 			ProtoV5ProviderFactories: testAccProtoV5MuxServerFactory,
 			Steps: []resource.TestStep{
 				{
-					Config: testAccConfigBasicTriggerTest(dataset, "info"),
+					Config: testAccConfigBasicTriggerTest(dataset, name, "info"),
 					Check: resource.ComposeAggregateTestCheckFunc(
 						testAccEnsureTriggerExists(t, "honeycombio_trigger.test"),
-						resource.TestCheckResourceAttr("honeycombio_trigger.test", "name", "Test trigger from terraform-provider-honeycombio"),
+						resource.TestCheckResourceAttr("honeycombio_trigger.test", "name", name),
 						resource.TestCheckResourceAttr("honeycombio_trigger.test", "frequency", "600"),
 						resource.TestCheckResourceAttr("honeycombio_trigger.test", "recipient.#", "2"),
 						resource.TestCheckResourceAttr("honeycombio_trigger.test", "threshold.0.exceeded_limit", "1"),
@@ -38,7 +39,7 @@ func TestAcc_TriggerResource(t *testing.T) {
 				},
 				// then update the PD Severity from info -> critical (the default)
 				{
-					Config: testAccConfigBasicTriggerTest(dataset, "critical"),
+					Config: testAccConfigBasicTriggerTest(dataset, name, "critical"),
 				},
 				{
 					ResourceName:        "honeycombio_trigger.test",
@@ -55,10 +56,10 @@ func TestAcc_TriggerResource(t *testing.T) {
 			ProtoV5ProviderFactories: testAccProtoV5MuxServerFactory,
 			Steps: []resource.TestStep{
 				{
-					Config: testAccConfigBasicTriggerTest_QuerySpec(dataset, "info"),
+					Config: testAccConfigBasicTriggerTest_QuerySpec(dataset, name, "info"),
 					Check: resource.ComposeAggregateTestCheckFunc(
 						testAccEnsureTriggerExists(t, "honeycombio_trigger.test"),
-						resource.TestCheckResourceAttr("honeycombio_trigger.test", "name", "Test trigger from terraform-provider-honeycombio"),
+						resource.TestCheckResourceAttr("honeycombio_trigger.test", "name", name),
 						resource.TestCheckResourceAttr("honeycombio_trigger.test", "frequency", "600"),
 						resource.TestCheckResourceAttr("honeycombio_trigger.test", "recipient.#", "2"),
 						resource.TestCheckResourceAttr("honeycombio_trigger.test", "threshold.0.exceeded_limit", "1"),
@@ -67,7 +68,7 @@ func TestAcc_TriggerResource(t *testing.T) {
 				},
 				// then update the PD Severity from info -> critical (the default)
 				{
-					Config: testAccConfigBasicTriggerTest_QuerySpec(dataset, "critical"),
+					Config: testAccConfigBasicTriggerTest_QuerySpec(dataset, name, "critical"),
 				},
 				{
 					ResourceName:        "honeycombio_trigger.test",
@@ -87,7 +88,7 @@ func TestAcc_TriggerResource(t *testing.T) {
 func TestAcc_TriggerResourceUpgradeFromVersion014(t *testing.T) {
 	dataset := testAccDataset()
 
-	config := testAccConfigBasicTriggerTest(dataset, "info")
+	config := testAccConfigBasicTriggerTest(dataset, test.RandomStringWithPrefix("test.", 20), "info")
 
 	resource.Test(t, resource.TestCase{
 		Steps: []resource.TestStep{
@@ -125,18 +126,19 @@ func TestAcc_TriggerResourceUpdateRecipientByID(t *testing.T) {
 	ctx := context.Background()
 	c := testAccClient(t)
 	dataset := testAccDataset()
+	name := test.RandomStringWithPrefix("test.", 20)
 
 	testRecipients := []client.Recipient{
 		{
 			Type: client.RecipientTypeEmail,
 			Details: client.RecipientDetails{
-				EmailAddress: acctest.RandString(8) + "@example.com",
+				EmailAddress: test.RandomEmail(),
 			},
 		},
 		{
 			Type: client.RecipientTypeSlack,
 			Details: client.RecipientDetails{
-				SlackChannel: "#" + acctest.RandString(8),
+				SlackChannel: test.RandomStringWithPrefix("#test.", 8),
 			},
 		},
 	}
@@ -160,14 +162,14 @@ func TestAcc_TriggerResourceUpdateRecipientByID(t *testing.T) {
 		ProtoV5ProviderFactories: testAccProtoV5MuxServerFactory,
 		Steps: []resource.TestStep{
 			{
-				Config: testAccConfigTriggerRecipientByID(dataset, testRecipients[0].ID, 3),
+				Config: testAccConfigTriggerRecipientByID(dataset, name, testRecipients[0].ID, 3),
 				Check: resource.ComposeAggregateTestCheckFunc(
 					resource.TestCheckResourceAttr("honeycombio_trigger.test", "recipient.0.id", testRecipients[0].ID),
 					resource.TestCheckResourceAttr("honeycombio_trigger.test", "threshold.0.exceeded_limit", "3"),
 				),
 			},
 			{
-				Config: testAccConfigTriggerRecipientByID(dataset, testRecipients[1].ID, 5),
+				Config: testAccConfigTriggerRecipientByID(dataset, name, testRecipients[1].ID, 5),
 				Check: resource.ComposeAggregateTestCheckFunc(
 					resource.TestCheckResourceAttr("honeycombio_trigger.test", "recipient.0.id", testRecipients[1].ID),
 					resource.TestCheckResourceAttr("honeycombio_trigger.test", "threshold.0.exceeded_limit", "5"),
@@ -179,6 +181,10 @@ func TestAcc_TriggerResourceUpdateRecipientByID(t *testing.T) {
 
 func TestAcc_TriggerResourceRecipientOrderingStable(t *testing.T) {
 	dataset := testAccDataset()
+	email1 := test.RandomEmail()
+	email2 := test.RandomEmail()
+	slack1 := test.RandomStringWithPrefix("#test.", 8)
+	slack2 := test.RandomStringWithPrefix("#test.", 8)
 
 	resource.Test(t, resource.TestCase{
 		PreCheck:                 testAccPreCheck(t),
@@ -214,22 +220,22 @@ resource "honeycombio_trigger" "test" {
 
   recipient {
     type   = "slack"
-    target = "#test2"
+    target = "%[2]s"
   }
 
   recipient {
     type   = "slack"
-    target = "#test"
+    target = "%[3]s"
   }
 
   recipient {
     type   = "email"
-    target = "bob@example.com"
+    target = "%[4]s"
   }
 
   recipient {
     type   = "email"
-    target = "alice@example.com"
+    target = "%[5]s"
   }
 
   recipient {
@@ -237,7 +243,7 @@ resource "honeycombio_trigger" "test" {
     target = "trigger fired"
   }
 }
-`, dataset),
+`, dataset, slack1, slack2, email1, email2),
 			},
 			{
 				// now remove two recipients and add a new one
@@ -270,25 +276,25 @@ resource "honeycombio_trigger" "test" {
 
   recipient {
     type   = "slack"
-    target = "#test"
+    target = "%[2]s"
   }
 
   recipient {
     type   = "email"
-    target = "bob@example.com"
+    target = "%[3]s"
   }
 
   recipient {
     type   = "email"
-    target = "alice@example.com"
+    target = "%[4]s"
   }
 
   recipient {
     type   = "slack"
-    target = "#a-new-channel"
+    target = "%[5]s"
   }
 }
-`, dataset),
+`, dataset, slack1, email2, email1, test.RandomStringWithPrefix("#test.", 8)),
 			},
 		},
 	})
@@ -460,7 +466,7 @@ func TestAcc_TriggerResourceHandlesRecipientChangedOutsideOfTerraform(t *testing
 	dataset := testAccDataset()
 
 	// setup a slack recipient to be used in the trigger, and modified outside of terraform
-	channel := "#" + acctest.RandString(8)
+	channel := test.RandomStringWithPrefix("#test.", 8)
 	rcpt, err := c.Recipients.Create(ctx, &client.Recipient{
 		Type: client.RecipientTypeSlack,
 		Details: client.RecipientDetails{
@@ -726,7 +732,11 @@ resource "honeycombio_trigger" "test" {
 	})
 }
 
-func testAccConfigBasicTriggerTest(dataset, pdseverity string) string {
+func testAccConfigBasicTriggerTest(dataset, name, pdseverity string) string {
+	email := test.RandomEmail()
+	pdKey := test.RandomString(32)
+	pdName := test.RandomStringWithPrefix("test.", 20)
+
 	return fmt.Sprintf(`
 data "honeycombio_query_specification" "test" {
   calculation {
@@ -742,12 +752,12 @@ resource "honeycombio_query" "test" {
 }
 
 resource "honeycombio_pagerduty_recipient" "test" {
-  integration_key  = "08b9d4cacd68933151a1ef1028b67da2"
-  integration_name = "testacc-basic"
+  integration_key  = "%[5]s"
+  integration_name = "%[6]s"
 }
 
 resource "honeycombio_trigger" "test" {
-  name    = "Test trigger from terraform-provider-honeycombio"
+  name    = "%[2]s"
   dataset = "%[1]s"
 
   description = "My nice description"
@@ -763,20 +773,24 @@ resource "honeycombio_trigger" "test" {
 
   recipient {
     type   = "email"
-    target = "hello@example.com"
+    target = "%[4]s"
   }
 
   recipient {
     id = honeycombio_pagerduty_recipient.test.id
 
     notification_details {
-      pagerduty_severity = "%[2]s"
+      pagerduty_severity = "%[3]s"
     }
   }
-}`, dataset, pdseverity)
+}`, dataset, name, pdseverity, email, pdKey, pdName)
 }
 
-func testAccConfigBasicTriggerTest_QuerySpec(dataset, pdseverity string) string {
+func testAccConfigBasicTriggerTest_QuerySpec(dataset, name, pdseverity string) string {
+	email := test.RandomEmail()
+	pdKey := test.RandomString(32)
+	pdName := test.RandomStringWithPrefix("test.", 20)
+
 	return fmt.Sprintf(`
 data "honeycombio_query_specification" "test" {
   calculation {
@@ -787,12 +801,12 @@ data "honeycombio_query_specification" "test" {
 }
 
 resource "honeycombio_pagerduty_recipient" "test" {
-  integration_key  = "08b9d4cacd68933151a1ef1028b67da2"
-  integration_name = "testacc-basic"
+  integration_key  = "%[5]s"
+  integration_name = "%[6]s"
 }
 
 resource "honeycombio_trigger" "test" {
-  name    = "Test trigger from terraform-provider-honeycombio"
+  name    = "%[2]s"
   dataset = "%[1]s"
 
   description = "My nice description"
@@ -808,20 +822,20 @@ resource "honeycombio_trigger" "test" {
 
   recipient {
     type   = "email"
-    target = "hello@example.com"
+    target = "%[4]s"
   }
 
   recipient {
     id = honeycombio_pagerduty_recipient.test.id
 
     notification_details {
-      pagerduty_severity = "%[2]s"
+      pagerduty_severity = "%[3]s"
     }
   }
-}`, dataset, pdseverity)
+}`, dataset, name, pdseverity, email, pdKey, pdName)
 }
 
-func testAccConfigTriggerRecipientByID(dataset, recipientID string, exceededLimit int) string {
+func testAccConfigTriggerRecipientByID(dataset, name, recipientID string, exceededLimit int) string {
 	return fmt.Sprintf(`
 data "honeycombio_query_specification" "test" {
   calculation {
@@ -838,20 +852,20 @@ resource "honeycombio_query" "test" {
 }
 
 resource "honeycombio_trigger" "test" {
-  name    = "Test trigger with changing recipient id"
+  name    = "%[2]s"
   dataset = "%[1]s"
   query_id = honeycombio_query.test.id
 
   threshold {
     op             = ">"
     value          = 100
-    exceeded_limit = %[3]d
+    exceeded_limit = %[4]d
   }
 
   recipient {
-    id = "%[2]s"
+    id = "%[3]s"
   }
-}`, dataset, recipientID, exceededLimit)
+}`, dataset, name, recipientID, exceededLimit)
 }
 
 func testAccConfigTriggerWithSlackRecipient(dataset, channel string) string {