https://github.com/rootlyhq/terraform-provider-rootly
Terraform provider for Rootly - manage incident management, on-call schedules, workflows, and alerts as code
https://github.com/rootlyhq/terraform-provider-rootly
devops go golang hashicorp iac incident-management incident-response infrastructure-as-code on-call rootly site-reliability-engineering sre terraform terraform-provider
Last synced: 14 days ago
JSON representation
Terraform provider for Rootly - manage incident management, on-call schedules, workflows, and alerts as code
- Host: GitHub
- URL: https://github.com/rootlyhq/terraform-provider-rootly
- Owner: rootlyhq
- License: mpl-2.0
- Created: 2022-03-04T21:53:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2026-03-01T04:22:48.000Z (24 days ago)
- Last Synced: 2026-03-01T06:43:16.262Z (24 days ago)
- Topics: devops, go, golang, hashicorp, iac, incident-management, incident-response, infrastructure-as-code, on-call, rootly, site-reliability-engineering, sre, terraform, terraform-provider
- Language: Go
- Homepage: https://registry.terraform.io/providers/rootlyhq/rootly
- Size: 5.57 MB
- Stars: 17
- Watchers: 4
- Forks: 12
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Rootly Provider
The [Rootly](https://rootly.com/) provider is used to interact with the resources supported by Rootly. The provider needs to be configured with the proper credentials before it can be used. It requires terraform 1.0 or later.
## Usage
Please see the [Terraform Registry documentation](https://registry.terraform.io/providers/rootlyhq/rootly/latest/docs) or [examples/](examples).
```terraform
terraform {
required_providers {
rootly = {
source = "rootlyhq/rootly"
}
}
}
provider "rootly" {
# We recommend using the `ROOTLY_API_TOKEN` env var to set the API Token
# when interacting with Rootly's API.
# api_token = var.rootly_api_key
}
```
## Migration Script
A migration script is available to help migrate from deprecated Rootly resources to their newer equivalents. The script automates the process of fetching existing resources via the Rootly API and generating Terraform configurations with import statements.
**Currently supported migrations:**
- `alert_routing_rules_to_alert_routes` - Migrate from deprecated `rootly_alert_routing_rule` to `rootly_alert_route`
For detailed usage instructions, see [Migration Script Documentation](scripts/migration/README.md).
## Develop
### Build Commands
| Command | Description |
|---------|-------------|
| `make build` | Complete build: generate code, compile provider, regenerate docs |
| `make codegen` | Download schema and auto-generate client code and provider resources |
| `make codegen `| Download schema and auto-generate client code and provider for the named resource |
| `make docs` | Regenerate Terraform documentation from provider schemas |
| `make test` | Run unit tests |
| `make testacc` | Run acceptance tests |
| `make help` | Show all available commands |
### Test your changes
Test your changes by running the acceptance tests.
For example, to test alerts source resource in `provider/resource_alerts_source_test.go`:
```
ROOTLY_API_TOKEN="xxx" make testacc TESTARGS="-run TestAccResourceAlertsSource"
```
To run the tests pointed at an API URL of your choice set the `ROOTLY_API_URL` environment variable.
To enable debug logs set `TF_LOG=DEBUG`.
### Updating provider
`make build` auto-generates code from Rootly's JSON-API schema, compiles provider code, and regenerates docs.
Some API resources are excluded from code generation if they are in the ignore-lists in `tools/generate.js`. If so, those resources will need to be updated manually.
Tests are often not able to be code generated. If so, add them to the ignore-list in `tools/generate.js` and implement manually.
### Version Management
The project uses [semantic versioning](https://semver.org) with git tags. Use these commands to manage versions:
#### Version Commands
```bash
make version-show # Show current and next versions
make version-patch # Bump patch version (1.2.3 → 1.2.4)
make version-minor # Bump minor version (1.2.3 → 1.3.0)
make version-major # Bump major version (1.2.3 → 2.0.0)
```
#### Release Commands
```bash
make release-patch # Bump patch version + push tag (triggers CI release)
make release-minor # Bump minor version + push tag (triggers CI release)
make release-major # Bump major version + push tag (triggers CI release)
```
#### Example Usage
```bash
# Check current version
make version-show
# Current version: v3.1.0
# Next patch: 3.1.1
# Bump patch version
make version-patch
# Creates and pushes v3.1.1 tag
# Or bump and push tag in one step (triggers CI release)
make release-patch
# Bumps to v3.1.1, pushes tag, CI builds and publishes release
```
**Important**: Use the `make version-*` commands instead of manually creating git tags. This ensures version consistency and proper validation.
### Release / Publish to Terraform Registry
Releases are automatically published to Terraform Registry when a new tag is pushed. The version management commands above handle this process:
1. **Version Bumping**: `make version-*` commands create and push git tags
2. **CI Trigger**: Pushed tags trigger CI/GoReleaser workflow
3. **Automatic Release**: CI builds and publishes releases to GitHub and Terraform Registry
4. **Version Injection**: The correct version is automatically set in the provider binary during CI build