terra_madre
Terra Madre - Terraform/HCL Types for Gleam
A Gleam library for representing and working with Terraform configurations.
Modules
terra_madre/hcl- Core HCL types (expressions, blocks, meta-arguments)terra_madre/terraform- Terraform-specific blocks (resource, provider, etc.)terra_madre/render- Render Terraform types to HCL strings
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 Config =
terraform.Config
pub type DataSource =
terraform.DataSource
pub type Lifecycle =
hcl.Lifecycle
pub type Locals =
terraform.Locals
pub type MetaArguments =
hcl.MetaArguments
pub type Module =
terraform.Module
pub type Output =
terraform.Output
pub type Provider =
terraform.Provider
pub type Resource =
terraform.Resource
pub type Variable =
terraform.Variable
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.