terra_madre

Terra Madre - Terraform/HCL Types for Gleam

A Gleam library for representing and working with Terraform configurations.

Modules

References

Example

import terra_madre/hcl
import terra_madre/terraform

// Create an AWS provider
let provider = terraform.simple_provider("aws", [
  #("region", hcl.StringLiteral("us-west-2")),
])

// Create an EC2 instance resource
let instance = terraform.simple_resource("aws_instance", "web", [
  #("ami", hcl.StringLiteral("ami-12345")),
  #("instance_type", hcl.StringLiteral("t2.micro")),
])

// Build a reference using dot notation
let ip_ref = hcl.ref("aws_instance.web.public_ip")

Types

pub type Block =
  hcl.Block
pub type Expr =
  hcl.Expr
pub type Lifecycle =
  hcl.Lifecycle
pub type MetaArguments =
  hcl.MetaArguments

Values

pub fn empty_config() -> terraform.Config

Create an empty Terraform configuration. Shorthand for terraform.empty_config.

pub fn empty_lifecycle() -> hcl.Lifecycle

Create empty lifecycle configuration. Shorthand for hcl.empty_lifecycle.

pub fn empty_meta() -> hcl.MetaArguments

Create empty meta-arguments. Shorthand for hcl.empty_meta.

pub fn ref(path: String) -> hcl.Expr

Build a reference chain from dot-notation. Shorthand for hcl.ref.

Search Document