Terraform modules for Pagerduty

Hi,

I have a pagerduty SaaS instance that already have all the configuration set via UI. Now I am planning to import the PD configuration to terraform.

  1. What will be best way to import the resources, do I need to import each pagerduty resource one by one ?

  2. What will be least impactful resource that I can start importing to terraform ?

  3. Is there terraform modules for pagerduty available for public to use and customize it as per my need ?

Awaiting for your responses, thanks

You could certainly write your own scripts/automation to pull your existing PagerDuty configurations via the API and then write them out into appropriate Terraform resources, modules, etc.

You could also look at the Terraformer project and start with the supported PagerDuty resources to get started. https://github.com/GoogleCloudPlatform/terraformer/blob/master/docs/pagerduty.md

This would bootstrap your Terraform files with these resources:

  • business_service
    • pagerduty_business_service
  • escalation_policy
    • pagerduty_escalation_policy
  • ruleset
    • pagerduty_ruleset
    • pagerduty_ruleset_rule
  • schedule
    • pagerduty_schedule
  • service
    • pagerduty_service
    • pagerduty_service_event_rule
  • team
    • pagerduty_team
    • pagerduty_team_membership
  • user
    • pagerduty_user

@dmcclure - Thanks for the information.

I can go with the Option 1 to pull the configuration and convert them to terraform.

I am hoping if there are any Terraform modules that are maintained offically by pagerduty so I could as a blueprint and customize it.

Regards,
Sampath

Everything here https://registry.terraform.io/providers/PagerDuty/pagerduty/latest/docs is maintained by PagerDuty and open for community collaboration.

1 Like