Terraspace: The Terraform Framework

Terraspace is a Terraform Framework that optimizes for infrastructure-as-code happiness. It provides an organized structure, conventions over configurations, keeps your code DRY, and adds convenient tooling. Terraspace makes working with Terraform easier and more fun.

The Code

Easy to learn


Commands

terraspace new project
terraspace new module
terraspace seed
terraspace build
terraspace up
terraspace down
terraspace all up
terraspace summary
terraspace test

Structure

├── app
│   ├── modules
│   │   ├── instance
│   │   ├── rds
│   │   ├── security_group
│   │   └── vpc
│   └── stacks
│       ├── app
│       ├── vpc
│       └── instance
└── config
    └── terraform
        ├── backend.tf
        └── provider.tf

Generators

$ terraspace new module example
=> Creating new module called example.
      create  app/modules/example
      create  app/modules/example/main.tf
      create  app/modules/example/outputs.tf
      create  app/modules/example/variables.tf
$

Testing

$ terraspace test
main
Building test harness...
Test harness built: /tmp/terraspace-test-harnesses/network
=> terraspace up example -y
=> terraform apply -auto-approve
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
  successful deploy
=> terraspace down example -y
=> terraform destroy -auto-approve
Destroy complete! Resources: 2 destroyed.

Finished in 30.21 seconds (files took 0.29861 seconds to load)
1 example, 0 failures
$

Deploy

$ terraspace up demo -y
Building .terraspace-cache/us-west-2/dev/stacks/demo
Built in .terraspace-cache/us-west-2/dev/stacks/demo
Current directory: .terraspace-cache/us-west-2/dev/stacks/demo
=> terraform apply -auto-approve
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
network_id = projects/tung-111222/global/networks/duck
$

Destroy

$ terraspace down demo -y
Building .terraspace-cache/us-west-2/dev/stacks/demo
Built in .terraspace-cache/us-west-2/dev/stacks/demo
Current directory: .terraspace-cache/us-west-2/dev/stacks/demo
=> terraform destroy -auto-approve
Destroy complete! Resources: 2 destroyed.
$

Learn More

Quick Start