Skip to content

This repo accompanies our blogpost titled "How to Write a Custom Terraform Provider Automatically with OpenAPI"

Notifications You must be signed in to change notification settings

logicmonitor/automated-terraform-provider

Repository files navigation

Automatically Writing a Terraform Provider for LogicMonitor



This is the companion code to our How to Write a Custom Terraform Provider Automatically With OpenAPI article.

Learn more by checking out the article!

Requirements

Building the Provider

Clone repository (here, using SSH):

$ git clone git@github.com:logicmonitor/automated-terraform-provider.git

Enter the provider directory and build the provider:

$ cd automated-terraform-provider/
$ make

The Makefile will then generate the code, build the binary, and copy it to the Terraform plugin directory.

Using the provider

The LogicMonitor Terraform Provider has two methods for setting required arguments: Environment Variables

export LM_API_ID=xyz
export LM_API_KEY=xyz
export LM_COMPANY=xyz

Provider Initialization

provider "logicmonitor" {
  api_id = var.logicmonitor_api_id
  api_key = var.logicmonitor_api_key
  company = var.logicmonitor_company
}

Test cases can be found in the /automated-terraform-provider/Test directory.

About

This repo accompanies our blogpost titled "How to Write a Custom Terraform Provider Automatically with OpenAPI"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •