oncall-engine/terraform/examples/basic.tf
Joey Orlando 933e7256e3
move local developer resources to ./dev folder (#2479)
# What this PR does

As part of #1953, I wanted to be able to easily locally modify my
Grafana instance's access control provisioning configuration. In the
`grafana` container in `docker-compose-developer.yml`, we already have
this:
```yml
volumes:
  - ./provisioning:/etc/grafana/provisioning
```
The `dev` directory has a `.gitignore` setup which is better suited for
what I would like to do. By default, if I add
`./dev/grafana/provisioning/access-control/custom-roles.yml`, it will be
git-ignored. This would've not been the case with the `./provisioning`
directory

*Other stuff*
- create `./dev/grafana` folder. This folder contains resources that are
volume mounted into the `grafana` container in
`docker-compose-developer.yml`.
  - We already had a `./dev/grafana.dev.ini` file, relocated this here.
  - Relocated `./provisioning` to `./dev/grafana/provisioning`. 
- consolidate `./examples/terraform` into `./terraform` directory

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated (N/A)
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required) (N/A)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required) (N/A)
2023-07-10 06:09:22 -04:00

42 lines
No EOL
966 B
HCL

terraform {
required_providers {
grafana = {
source = "grafana/grafana"
version = ">= 1.22.0"
}
}
}
provider "grafana" {
alias = "oncall"
oncall_access_token = <YOUR_API_TOKEN>
}
data "grafana_oncall_user" "ikonstantinov" {
provider = grafana.oncall
username = "ikonstantinov"
}
resource "grafana_oncall_integration" "prod_alertmanager" {
provider = grafana.oncall
name = "Prod AM"
type = "alertmanager"
default_route {
escalation_chain_id = grafana_oncall_escalation_chain.default.id
}
}
resource "grafana_oncall_escalation_chain" "default" {
provider = grafana.oncall
name = "default"
}
resource "grafana_oncall_escalation" "notify_me_step" {
provider = grafana.oncall
escalation_chain_id = grafana_oncall_escalation_chain.default.id
type = "notify_persons"
persons_to_notify = [
data.grafana_oncall_user.ikonstantinov.id
]
position = 0
}