# Example of epilot's OpenAPI spec with Speakeasy annotations
Source: https://speakeasy.com/customers/epilot

import { Card, Table } from "@/mdx/components";

## Company Info
- **Company:** epilot
- **Industry:** Enterprise SaaS
- **Website:** [epilot.cloud](https://epilot.cloud/)

## Key Takeaways

- 8X reduction in expected cost of Terraform Provider ($220K cost saving)
- Generated from OpenAPI specs for a minimal learning curve
- No need to invest in hiring teams of specialist engineers — maintain focus on core product development

---

## Automating Terraform Provider Creation Cuts Costs by 8X and Accelerates Go-to-Market

Prior to Speakeasy, epilot's Solutions Engineering team needed to work with each customer manually to set up their epilot instance. Viljami Kuosmanen, epilot's Head of Engineering, realized that epilot setup could be automated via their existing APIs, and that a language for configuring infrastructure already existed — Terraform.

The only piece they were missing was a Terraform provider. Terraform providers allow Terraform code to interact with an API. In epilot's case, they could create Terraform configuration files that communicate with the epilot Terraform provider (and ultimately, the epilot API), to automate the setup/configuration process. This would make setting up a new customer in epilot as easy as running a single command.

Viljami recognized that building an entire suite of Terraform providers would require significant creation and maintenance cost however: in fact, **their initial budget estimate was $250K per year to hire a dedicated team of Go engineers.**

<Card
  variant="primary"
  className="my-10"
  imageUrl="/public/assets/terraform.png"
  title="Terraform Generation Workflow"
  description="Speakeasy automatically generates Terraform providers from OpenAPI specs, reducing development time and cost."
/>

<Card
  variant="testimonial"
  className="my-10"
  quote="We want to put as many of our API endpoints in Terraform as possible. But we realized that writing Go was a big lift - we'd need to hire new engineers. Speakeasy has made it super easy for us to maintain Terraform providers."
  author={{
    name: "Viljami Kuosmanen, Head of Engineering at epilot",
    avatar: "/media/quote-headshots/viljami-kuosmanen.jpeg"
  }}
/>

## The Solution: OpenAPI-based Terraform Generation with Speakeasy

epilot are huge advocates of the OpenAPI framework. Viljami himself is the maintainer of several OpenAPI-based tools such as the OpenAPI backend project.

Internally, the epilot team uses their OpenAPI spec as the primary source of truth for their API development, automating as many workflows as possible.

All the epilot team had to do was add some simple annotations to their OpenAPI spec, describing the Terraform resources that they wanted to create:

```yaml

/v1/permissions/roles/{roleId}:
  get:
    operationId: getRole
    summary: getRole
    x-speakeasy-entity-operation: Role#get
    description: Get role by id
    tags:
      - Roles
    parameters:
      - name: roleId
        x-speakeasy-match: id
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/RoleId"
    responses:
      "200":
        description: ok
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Role"
Role:
  x-speakeasy-entity: Role
  oneOf:
    - $ref: "#/components/schemas/UserRole"
    - $ref: "#/components/schemas/OrgRole"
    - $ref: "#/components/schemas/ShareRole"
    - $ref: "#/components/schemas/PartnerRole"
```

Now, whenever the epilot team updates their OpenAPI specs, Speakeasy's Github workflow automatically regenerates their Terraform providers, runs a suite of tests, and then publishes a new version to the registry. No maintenance work required!

<Card
  variant="testimonial"
  className="my-10"
  quote="Speakeasy's unique offering of high-quality SDKs including a Terraform provider, all generated from our existing API specs allowed us to take a huge leap in our own product go-to-market. We don't need to invest in hiring teams of specialist engineers — allowing us to focus on our core product."
  author={{
    name: "Viljami Kuosmanen, Head of Engineering at epilot",
    avatar: "/media/quote-headshots/viljami-kuosmanen.jpeg"
  }}
/>

## The Results: New Use Cases And New Customers

The proof is in the provider: [epilot's Registered Terraform Providers](https://registry.terraform.io/namespaces/epilot-dev)

Through the use of OpenAPI and Speakeasy, epilot was able to automate the creation of Terraform Providers, resulting in a massive acceleration of their roadmap at a fraction of the expected cost.

---

<Table
  title="Impact of Speakeasy for epilot"
  columns={[
    { key: "metric", header: "Metric" },
    { key: "before", header: "Before Speakeasy" },
    { key: "after", header: "With Speakeasy" }
  ]}
  data={[
    {
      metric: "Annual cost for Terraform providers",
      before: "$250K (estimated)",
      after: "$30K"
    },
    {
      metric: "Engineering resources",
      before: "Dedicated team of Go engineers",
      after: "Existing engineers maintain OpenAPI specs"
    },
    {
      metric: "Time to set up new customers",
      before: "Manual process by Solutions Engineering",
      after: "Automated via Terraform in minutes"
    },
    {
      metric: "Ongoing maintenance",
      before: "Manual updates to providers",
      after: "Automatic regeneration from OpenAPI specs"
    }
  ]}
  rowKeyField="metric"
  className="my-8"
/>