Search…
Terraform Provider
A Terraform provider for managing resources on your Cased account.

Terraform Provider Cased

A Terraform provider for managing resources on your Cased account.
Currently, this provider supports:
  • Managing workflows
  • Managing webhooks

Requirements

Building The Provider

  1. 1.
    Clone the repository
  2. 2.
    Enter the repository directory
  3. 3.
    Build the provider using the Go install command:
1
$ go install
Copied!

Using the provider

Creating workflows workflow

1
terraform {
2
required_providers {
3
cased = {
4
source = "cased/cased"
5
version = "0.0.1"
6
}
7
}
8
}
9
10
provider "cased" {
11
# Grab your Workflow API key from the API keys page:
12
# https://app.cased.com/settings/api-keys
13
workflows_api_key = ""
14
}
15
16
resource "cased_webhooks_endpoint" "webhook-endpoint" {
17
url = "https://app.cased.com/webhooks/endpoint"
18
19
// event_types is optional, subscribed to all event types of left blank
20
event_types = ["event.created"]
21
}
22
23
// The webhook secret is accessible so you can set environment variables
24
output "cased_webhooks_endpoint_secret" {
25
value = cased_webhooks_endpoint.webhook-endpoint.secret
26
}
27
28
resource "cased_workflow" "database-provisioning" {
29
name = "database-provisioning"
30
31
# At least one control is required: reason, authentication, or approval.
32
controls {
33
reason = true
34
authentication = true
35
36
approval {
37
# Optional: How many approvals are required to approve the workflow. (Default: 1)
38
count = 2
39
40
# Optional: Can the authenticated user self approve the request? (Default: false)
41
self_approval = false
42
43
# Optional: Restrict who can respond to the request
44
responders {
45
# User
46
responder {
47
48
}
49
50
# Someone from managers group must respond
51
responder {
52
name = "managers"
53
required = true
54
}
55
}
56
57
# Specify where the approval request will get delivered to.
58
sources {
59
# You must connect your Slack workspace with your Cased account on your
60
# integrations page: https://app.cased.com/settings/integrations
61
slack {
62
channel = "#cased-workflows"
63
}
64
}
65
}
66
}
67
}
Copied!

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).
To compile the provider, run go install. This will build the provider and put the provider binary in the $GOPATH/bin directory.
To generate or update documentation, run go generate.
Last modified 1mo ago