Skip to content

Commit

Permalink
fix conflicts with 1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott McAllister committed Sep 22, 2021
2 parents bbfbff5 + 50ea004 commit 58f18b4
Show file tree
Hide file tree
Showing 16 changed files with 1,019 additions and 17 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.11.0 (September 9, 2021)
FEATURES:
* `resource/pagerduty_slack_connection`: Added resource to manage Slack Connections (aka Slack v2) ([#381](https://github.com/PagerDuty/terraform-provider-pagerduty/pull/381))

BUG FIXES:
* `resource/pagerduty_service`: Clarified docs surrounding the `scheduled_actions` block on the service resource ([#360](https://github.com/PagerDuty/terraform-provider-pagerduty/pull/360))

## 1.10.1 (August 16, 2021)
FEATURES:
* `data_source_pagerduty_service_integration`: Add new data source for Service Integrations ([#363](https://github.com/PagerDuty/terraform-provider-pagerduty/pull/363))
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ In order to run the full suite of Acceptance tests, run `make testacc`.
```sh
$ make testacc
```

*Additional Note:* In order for the tests on the Slack Connection resources to pass you will need valid Slack workspace and channel IDs from a [Slack workspace connected to your PagerDuty account](https://support.pagerduty.com/docs/slack-integration-guide#integration-walkthrough).
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
cloud.google.com/go v0.71.0 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/hashicorp/terraform-plugin-sdk v1.7.0
github.com/heimweh/go-pagerduty v0.0.0-20210811005434-dc24e464325a
github.com/heimweh/go-pagerduty v0.0.0-20210831220234-54710c5e87d1
go.mongodb.org/mongo-driver v1.7.0 // indirect
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd // indirect
google.golang.org/api v0.35.0 // indirect
Expand Down
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,16 @@ github.com/heimweh/go-pagerduty v0.0.0-20210810155842-7de939d717c0 h1:F3c5KAaStF
github.com/heimweh/go-pagerduty v0.0.0-20210810155842-7de939d717c0/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY=
github.com/heimweh/go-pagerduty v0.0.0-20210811005434-dc24e464325a h1:mPx+k0gk1FNkQgWutkSFO/IYcHFv8ueUdA/1hIDkO9E=
github.com/heimweh/go-pagerduty v0.0.0-20210811005434-dc24e464325a/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY=
github.com/heimweh/go-pagerduty v0.0.0-20210817215245-9604e31ec66b h1:e4lTBCIrfI2Fq6MmQpEv7ejyearCTVw0m8WaW/G6a+Y=
github.com/heimweh/go-pagerduty v0.0.0-20210817215245-9604e31ec66b/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY=
github.com/heimweh/go-pagerduty v0.0.0-20210825175603-80b7f8a9ddd7 h1:glR2g8bLfJzRJaSX13tK2aBd7QiZttr7xpfhxwXq1jY=
github.com/heimweh/go-pagerduty v0.0.0-20210825175603-80b7f8a9ddd7/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY=
github.com/heimweh/go-pagerduty v0.0.0-20210825225232-caa0f6e992e6 h1:N39eXQVRlxiy0Of5NBJVhv0x3Jjsu3piCZY5v9Gy+vM=
github.com/heimweh/go-pagerduty v0.0.0-20210825225232-caa0f6e992e6/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY=
github.com/heimweh/go-pagerduty v0.0.0-20210826184549-45940c9493fc h1:qK78KCqtm+9NDIWPffdGy9udPf7TX9iX+BRpocjhYpw=
github.com/heimweh/go-pagerduty v0.0.0-20210826184549-45940c9493fc/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY=
github.com/heimweh/go-pagerduty v0.0.0-20210831220234-54710c5e87d1 h1:yBAqdyzvIpGktzh8EnWqaXAtwhdgWqrP2Zk53MDH89Y=
github.com/heimweh/go-pagerduty v0.0.0-20210831220234-54710c5e87d1/go.mod h1:6+bccpjQ/PM8uQY9m8avM4MJea+3vo3ta9r8kGQ4XFY=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
Expand Down
64 changes: 64 additions & 0 deletions pagerduty/import_pagerduty_slack_connection_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package pagerduty

import (
"fmt"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

func TestAccPagerDutySlackConnection_import(t *testing.T) {
username := fmt.Sprintf("tf-%s", acctest.RandString(5))
email := fmt.Sprintf("%s@foo.com", username)
escalationPolicy := fmt.Sprintf("tf-%s", acctest.RandString(5))
service := fmt.Sprintf("tf-%s", acctest.RandString(5))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckPagerDutySlackConnectionDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckPagerDutySlackConnectionConfig(username, email, escalationPolicy, service, workspaceID, channelID),
},
{
Config: testAccCheckPagerDutySlackConnectionConfigUpdated(username, email, escalationPolicy, service, workspaceID, channelID),
},
{
ResourceName: "pagerduty_slack_connection.foo",
ImportStateIdFunc: testAccCheckPagerDutySlackConnectionID,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccPagerDutySlackConnectionTeam_import(t *testing.T) {
team := fmt.Sprintf("tf-%s", acctest.RandString(5))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckPagerDutySlackConnectionDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckPagerDutySlackConnectionConfigTeam(team, workspaceID, channelID),
},
{
ResourceName: "pagerduty_slack_connection.foo",
ImportStateIdFunc: testAccCheckPagerDutySlackConnectionID,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccCheckPagerDutySlackConnectionID(s *terraform.State) (string, error) {
scatts := s.RootModule().Resources["pagerduty_slack_connection.foo"].Primary.Attributes

return fmt.Sprintf("%v.%v", scatts["workspace_id"], s.RootModule().Resources["pagerduty_slack_connection.foo"].Primary.ID), nil
}
1 change: 1 addition & 0 deletions pagerduty/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func Provider() terraform.ResourceProvider {
"pagerduty_response_play": resourcePagerDutyResponsePlay(),
"pagerduty_tag": resourcePagerDutyTag(),
"pagerduty_service_event_rule": resourcePagerDutyServiceEventRule(),
"pagerduty_slack_connection": resourcePagerDutySlackConnection(),
},
}

Expand Down
Loading

0 comments on commit 58f18b4

Please sign in to comment.