Example repository to manage PagerDuty with Terraform and GitHub Actions, using GCS as Remote State Backend. This example sets up 3 users, 2 schedules and 2 integrations that are compatible with Alertmanager. This is a fairly trivial example, but allows to automate quite a lot of repetitive UI work.
- PagerDuty API Token Generation a general access REST API key
- GCP Account, Project, GCS bucket for state and Service Account JSON Key with Read/Write permissions for the aforementioned bucket.
- PAGERDUTY_TOKEN
- GOOGLE_CREDENTIALS (Insert entire content of Service Account JSON key into the secret)
Terraform will run init, fmt, validate and plan. Results of the plan will be set as a comment on the PR.
Terraform will run init, validate and apply. Output will print integration keys if you've chaned/added any.
I highly recommend playing with API Reference to understand all the moving parts of your existing setup and then importing those with terraform.
e.g. of importing an existing user:
terraform import 'pagerduty_user.user["alice"]' AL123C