Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 1.48 KB

README.md

File metadata and controls

48 lines (38 loc) · 1.48 KB

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.