hashicorp / pandora

A suite of single-purpose tools enabling automation for Terraform/Azure
Mozilla Public License 2.0
65 stars 46 forks source link

Pandora

Pandora is a suite of single-purpose tools which enable transforming the Azure API Definitions into both a Go SDK and Terraform Resources.

These tools are:

  1. Rest API Specs Importer - imports data from the Azure Rest API Specs repository into the API Definitions format used by the Data API.
  2. Data API - exposes the imported API Definitions over an HTTP API (for ease of consumption in other tooling).
  3. Go SDK Generator - generates a Go SDK using data from the Data API.
  4. Terraform Generator - generates Terraform Resources using data from the Data API.
  5. Version Bumper - automatically detects and proposes importing new Services and API Versions for Azure Resource Manager.

At the current time only Resource Manager Services are supported - although we're looking to support Microsoft Graph and (potentially) the Data Plane APIs in the future.

Getting Started

The following dependencies are required:

At first checkout you'll need to both initialize and then update the Git submodule:

$ git submodule init
$ git submodule update

The Swagger Git Submodule is updated every weekday (via Dependabot) - once updated you'll need to update your submodule, via:

$ git submodule update

How does this work?

Pandora's primarily intended to be run in automation (using both Github Actions and Dependabot) - which gets run once a Pull Request is merged.

To show the workflow with examples:

  1. A Pull Request is opened to add a new Service/API version to the config (example).
  2. Once that Pull Request is merged that generates a Data API PR (example).
  3. Once that Pull Request is merged that generates a Go SDK PR (example).
  4. Once that Pull Request is merged the SDK is automatically released (e.g. we add a new git tag).

For information and guides and on how to contribute, add services, service versions or resources, see the overview of guides located in the ./docs.

Project Structure

There's also few helper tools (for example, for use in automation):

The following paths are still a work-in-progress: