Ask HN: Why is there no Terraform OpenAPI generator?

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • openapi-generator

    OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)

  • Hi folks,

    My company has an OpenAPI3 spec. We have a community supported Terraform provider that we are moving in-house soon.

    I was wondering why there is no easy way to generate a Terraform provider from an OpenAPI spec?

    There's no open issue in the generator project[0].

    Some googling turned up a couple of projects[1],[2], but they only support Swagger; OpenAPI is the successor to Swagger. There is some progress on supporting OpenAPI[3]. I also found this provider, which is a thin wrapper around REST calls[4].

    It's not discussed very much on the Terraform forum[5].

    Either I'm missing the need for this or underestimating the difficulty.

    0: https://github.com/OpenAPITools/openapi-generator/issues?q=is%3Aissue+is%3Aopen+terraform

    1: https://www.logicmonitor.com/blog/how-to-write-a-custom-terraform-provider-automatically-with-openapi

    2: https://github.com/dikhan/terraform-provider-openapi

    3: https://github.com/dikhan/terraform-provider-openapi/pull/320

    4: https://github.com/Mastercard/terraform-provider-restapi

    5: https://discuss.hashicorp.com/t/sdk-provider-development-anyone-ever-used-code-generation-or-other-tools-to-simplify-their-provider-development/20301/2

  • terraform-provider-openapi

    OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)

  • Hi folks,

    My company has an OpenAPI3 spec. We have a community supported Terraform provider that we are moving in-house soon.

    I was wondering why there is no easy way to generate a Terraform provider from an OpenAPI spec?

    There's no open issue in the generator project[0].

    Some googling turned up a couple of projects[1],[2], but they only support Swagger; OpenAPI is the successor to Swagger. There is some progress on supporting OpenAPI[3]. I also found this provider, which is a thin wrapper around REST calls[4].

    It's not discussed very much on the Terraform forum[5].

    Either I'm missing the need for this or underestimating the difficulty.

    0: https://github.com/OpenAPITools/openapi-generator/issues?q=is%3Aissue+is%3Aopen+terraform

    1: https://www.logicmonitor.com/blog/how-to-write-a-custom-terraform-provider-automatically-with-openapi

    2: https://github.com/dikhan/terraform-provider-openapi

    3: https://github.com/dikhan/terraform-provider-openapi/pull/320

    4: https://github.com/Mastercard/terraform-provider-restapi

    5: https://discuss.hashicorp.com/t/sdk-provider-development-anyone-ever-used-code-generation-or-other-tools-to-simplify-their-provider-development/20301/2

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • terraform-provider-restapi

    A terraform provider to manage objects in a RESTful API

  • Hi folks,

    My company has an OpenAPI3 spec. We have a community supported Terraform provider that we are moving in-house soon.

    I was wondering why there is no easy way to generate a Terraform provider from an OpenAPI spec?

    There's no open issue in the generator project[0].

    Some googling turned up a couple of projects[1],[2], but they only support Swagger; OpenAPI is the successor to Swagger. There is some progress on supporting OpenAPI[3]. I also found this provider, which is a thin wrapper around REST calls[4].

    It's not discussed very much on the Terraform forum[5].

    Either I'm missing the need for this or underestimating the difficulty.

    0: https://github.com/OpenAPITools/openapi-generator/issues?q=is%3Aissue+is%3Aopen+terraform

    1: https://www.logicmonitor.com/blog/how-to-write-a-custom-terraform-provider-automatically-with-openapi

    2: https://github.com/dikhan/terraform-provider-openapi

    3: https://github.com/dikhan/terraform-provider-openapi/pull/320

    4: https://github.com/Mastercard/terraform-provider-restapi

    5: https://discuss.hashicorp.com/t/sdk-provider-development-anyone-ever-used-code-generation-or-other-tools-to-simplify-their-provider-development/20301/2

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts