OpsLevel now has an officially supported terraform provider and as such would like to direct you to begin using it over this one. OpsLevel would like to thank Zapier for beginning this terraform provider as it provided a great jumping off point!
Terraform Provider for OpsLevel.com
terraform {
required_providers {
opslevel = {
source = "zapier/opslevel"
}
}
}
provider "opslevel" {
# token = "eyJhbGciOi..." // or environment variable OPSLEVEL_TOKEN
}
resource "opslevel_service" "foo" {
name = "foo"
description = "foo service"
framework = "rails"
language = "ruby"
aliases = [
"bar"
]
tags = {
foo = "bar"
}
}
# read a single service by `alias` or `id`
data "opslevel_services" "foo" {
filter {
field = "alias"
value = opslevel_service.foo.aliases.0
}
}
# retrieve several services matching framework
data "opslevel_services" "django" {
filter {
field = "framework"
value = "django"
}
}
# retrieve several services matching tag
data "opslevel_services" "production" {
filter {
field = "tag"
value = "production:true"
}
}
data "opslevel_teams" "all" {}
output "all_teams" {
value = data.opslevel_teams.all.teams
}
- Clone the repository
- Enter the repository directory
- Build the provider using the Go
install
command:
$ go install