https://github.com/howdoicomputer/terrashovel
A terraform module scaffolder.
https://github.com/howdoicomputer/terrashovel
aws awspec infrastructure kitchen terraform
Last synced: about 2 months ago
JSON representation
A terraform module scaffolder.
- Host: GitHub
- URL: https://github.com/howdoicomputer/terrashovel
- Owner: howdoicomputer
- License: apache-2.0
- Created: 2017-06-12T10:33:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-17T19:10:32.000Z (over 8 years ago)
- Last Synced: 2024-11-16T02:00:22.046Z (over 1 year ago)
- Topics: aws, awspec, infrastructure, kitchen, terraform
- Language: Go
- Size: 5.42 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
Terrashovel is a very small CLI that scaffolds out a Terraform module.
# Installation
If you have Go installed and setup:
`go get -u github.com/howdoicomputer/terrashovel`
Otherwise, grab the [latest release](https://github.com/howdoicomputer/terrashovel/releases) and put it somewhere in your $PATH.
# Usage
```
terrashovel create tf_test_module
cd tf_test_module
bundle install
bundle exec kitchen test
```
The scaffolding for the generated module deploys a single t2.micro instance into AWS and includes a single test to verify that the instance exists. The `main.tf` for the module looks like this:
```
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["099720109477"] # Canonical
}
resource "aws_instance" "foo" {
instance_type = "t2.micro"
ami = "${data.aws_ami.ubuntu.id}"
tags {
Name = "${var.name}"
Testing = "${var.testing}"
}
}
```
In a future release, I'll be moving all *working* code into files that are only generated under a `--generate-example` flag and having the default scaffolding generate non-functional, empty files.
# Assumptions
The test suite used to validate created infrastructure is written in Ruby. While not a requirement for Terrashovel per se, a Ruby environment is required to install and run the suite (`bundle exec kitchen test`). To satisfy that requirement, I recommend [RVM](https://rvm.io/).
---