docs: add developer-workflow.org and language examples
Complete workflow guide for Perl, Python, Go, Ansible, Terraform, Podman. Includes working example files in examples/ directory.
This commit is contained in:
39
examples/terraform/main.tf
Normal file
39
examples/terraform/main.tf
Normal file
@@ -0,0 +1,39 @@
|
||||
# main.tf — Demonstrates core Terraform features for Doom Emacs workflow.
|
||||
#
|
||||
# Navigate: SPC s i (imenu), SPC s p (grep in project)
|
||||
# Format: SPC m f (terraform fmt), Init: SPC m i, Plan: SPC m p
|
||||
#
|
||||
# Uses null_resource for a provider-free demo. Replace with real providers
|
||||
# (aws, azurerm, google) for actual infrastructure.
|
||||
|
||||
terraform {
|
||||
required_version = ">= 1.5"
|
||||
required_providers {
|
||||
null = {
|
||||
source = "hashicorp/null"
|
||||
version = "~> 3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# A null resource that runs a local command — useful for demos and provisioning
|
||||
resource "null_resource" "hello" {
|
||||
triggers = {
|
||||
message = var.greeting_message
|
||||
}
|
||||
|
||||
provisioner "local-exec" {
|
||||
command = "echo '${var.greeting_message}' > /tmp/terraform-hello.txt"
|
||||
}
|
||||
}
|
||||
|
||||
# Output the greeting message for verification
|
||||
output "greeting" {
|
||||
description = "The greeting message written to file"
|
||||
value = var.greeting_message
|
||||
}
|
||||
|
||||
output "environment" {
|
||||
description = "Current deployment environment"
|
||||
value = var.environment
|
||||
}
|
||||
18
examples/terraform/variables.tf
Normal file
18
examples/terraform/variables.tf
Normal file
@@ -0,0 +1,18 @@
|
||||
# variables.tf — Input variables for the Terraform demo.
|
||||
|
||||
variable "greeting_message" {
|
||||
description = "Message to write to the output file"
|
||||
type = string
|
||||
default = "Hello from Terraform!"
|
||||
}
|
||||
|
||||
variable "environment" {
|
||||
description = "Deployment environment name"
|
||||
type = string
|
||||
default = "dev"
|
||||
|
||||
validation {
|
||||
condition = contains(["dev", "staging", "prod"], var.environment)
|
||||
error_message = "Environment must be dev, staging, or prod."
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user