Skip to content

Commit

Permalink
Merge pull request #866 from cjgajard/tpf-addon
Browse files Browse the repository at this point in the history
Migrate pack #2 of datasources and resources to terraform plugin framework
  • Loading branch information
imjaroiswebdev authored Jun 13, 2024
2 parents 20015d0 + 523f2cf commit e396059
Show file tree
Hide file tree
Showing 43 changed files with 1,585 additions and 623 deletions.
1 change: 1 addition & 0 deletions pagerduty/data_source_pagerduty_service_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/heimweh/go-pagerduty/pagerduty"
)

// Deprecated: Migrated to pagerdutyplugin.dataSourceIntegration. Kept for testing purposes.
func dataSourcePagerDutyServiceIntegration() *schema.Resource {
return &schema.Resource{
Read: dataSourcePagerDutyServiceIntegrationRead,
Expand Down
4 changes: 3 additions & 1 deletion pagerduty/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ func Provider(isMux bool) *schema.Provider {
"pagerduty_ruleset": resourcePagerDutyRuleset(),
"pagerduty_ruleset_rule": resourcePagerDutyRulesetRule(),
"pagerduty_business_service": resourcePagerDutyBusinessService(),
"pagerduty_service_dependency": resourcePagerDutyServiceDependency(),
"pagerduty_response_play": resourcePagerDutyResponsePlay(),
"pagerduty_service_event_rule": resourcePagerDutyServiceEventRule(),
"pagerduty_slack_connection": resourcePagerDutySlackConnection(),
Expand Down Expand Up @@ -150,7 +149,10 @@ func Provider(isMux bool) *schema.Provider {

if isMux {
delete(p.DataSourcesMap, "pagerduty_business_service")
delete(p.DataSourcesMap, "pagerduty_service")
delete(p.DataSourcesMap, "pagerduty_service_integration")

delete(p.ResourcesMap, "pagerduty_addon")
delete(p.ResourcesMap, "pagerduty_business_service")
}

Expand Down
15 changes: 15 additions & 0 deletions pagerduty/resource_pagerduty_maintenance_window_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,18 @@ resource "pagerduty_maintenance_window" "foo" {
}
`, desc, start, end)
}

func testAccCheckPagerDutyAddonDestroy(s *terraform.State) error {
client, _ := testAccProvider.Meta().(*Config).Client()
for _, r := range s.RootModule().Resources {
if r.Type != "pagerduty_addon" {
continue
}

if _, _, err := client.Addons.Get(r.Primary.ID); err == nil {
return fmt.Errorf("Add-on still exists")
}

}
return nil
}
Loading

0 comments on commit e396059

Please sign in to comment.