#yaml #terraform #hcl #schema #mustache #templating #converter

app slo-converter

A command line tool that can convert particular YAML schemas to Terraform HCL while also providing support for mustache templating

21 releases (8 stable)

1.4.0 Sep 6, 2023
1.3.0 Jul 5, 2023
1.2.2 Mar 30, 2023
0.8.1 Nov 23, 2022
0.6.0 Jul 7, 2022

#164 in Template engine

Apache-2.0

72KB
2K SLoC

Rust 1.5K SLoC // 0.0% comments HCL 147 SLoC // 0.0% comments Shell 55 SLoC // 0.2% comments

SLO Converter

crates.io

SLO converter is a command line interface that converts YAML, adhering to the Figure SLO Schema, to HCL.

Usage

cargo install slo-converter
A command line tool that can convert particular YAML schemas to Terraform HCL while also providing support for mustache templating.

Usage: slo-converter [OPTIONS] --env <ENV> <YAML> [KEY_VALUES]...

Arguments:
  <YAML>           Path to YAML file
  [KEY_VALUES]...  Key/value pairs delineated with "=" which can render with mustache templating (e.g. k1=v1 k2=v2)

Options:
      --output <OUTPUT>  [default: stdout] [possible values: stdout]
      --env <ENV>        [possible values: development, figure-pay-test, figure-pay-sandbox, figure-pay-prod, figure-tech, figure-tech-test, pio, pio-test, production]
  -l, --lint             Returns a status code based on input parsing
  -h, --help             Print help
  -V, --version          Print version
slo-converter --env figure-pay-test yaml/one-slo.yaml

Templated Values

Mustache style templating is supported for all fields in the yaml file. This is most useful for environment specific tags or alerting channels. Values are passed with the following parameters (see yaml/multiple-slo.yaml for syntax usage):

slo-converter --env development yaml/multiple-slo.yaml critical_alert=\@slack-eng-tech warn_alert=\@slack-eng-tech

Creating SLOs for Figure Products

Notion documentation Github Action

Assisting Initial SLO Development

There's a few domain specific gotchas. A handy script is provided that can be ran like this.

./resource_helper.sh service-task development

NOTE: This script samples recent traces from Datadog. In order to get the best results, you should run against an environment that receives the most traffic.

The output of this script will help inform you if your service is using netty vs tomcat. This is important because your web service metrics will differ, e.g. trace.netty.request, trace.servlet.request. It will also help you verify your health check endpoints, as services use differing conventions.

Further SLO/SLI Resources

Dependencies

~7MB
~109K SLoC