0.1.0-alpha.1 • Published 5 years ago

@innovationnorway/terraform-config v0.1.0-alpha.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@innovationnorway/terraform-config

npm.io

Note: work in progress — highly subject to change

Usage

import * as tfconfig from '@innovationnorway/terraform-config'

const fileName = 'example.tf'
const src = `
terraform {
  required_version = ">= 0.12.7"
  required_providers {
    random = ">= 2.2.0"
  }
}

variable "name_prefix" {
  type        = string
  description = "Creates a unique name beginning with the specified prefix."
}

resource "random_id" "test" {
  keepers = {
    # Generate a new id each time we change the name prefix
    name_prefix = var.name_prefix
  }

  byte_length = 4
}
`
const file = tfconfig.parse(fileName, src)
console.log(file)