Terraform training wheels for DC/OS Users
This project helps you getting started with terraform-based deployments if you are new to terraform, yet experienced DC/OS users. This tool is not a replacement to terraform, but it rather helps you build some expertise around the tool.
The terraform-wheels is a pass-through wrapper around terraform. This means that they are 100% command-line compatible with terraform.
It only provides the following additional functionality:
- Makes sure that the
terraformversion used is exactly 0.11.x - Makes sure that there is an
ssh-agentrunning and the correct keys are installed - Makes sure you have the correct AWS credentials for launching a cluster
- Performs sanity checks to the terraform configuration files and provides helpful messages
- It provides some additional commands to create terraform files from scratch.
💁♂️ TIP: Consider
alias tw=terraform-wheelto simplify your workflow
You can download the pre-compiled binary from the releases page using:
curl -L https://github.com/mesosphere-incubator/terraform-wheels/releases/download/v0.0.3/terraform-wheels-darwin-amd64.tar.gz \
| tar -zx -C /usr/local/bin
If you have a go build environment available, you can install it using:
go get -u github.com/mesosphere-incubator/terraform-wheels
The tool supports self-upgrade, so if you want to get the latest released version, just do:
terraform-wheels wheels-upgrade-
Create an empty directory and chdir into it
-
Run
terraform-wheels add-aws-clusterto create a DC/OS cluster deployment file -
Open
cluster-aws.tfand adjust the parameters to your needs -
Deploy your cluster doing:
terraform-wheels plan -out=plan.out terraform-wheels apply plan.out
-
To destroy the cluster do:
terraform-wheels destroy
ℹ️ You can run this command multiple times to deploy multiple services. You can even run it after you have added a DC/OS cluster definition; in which case both a cluster and your service will be provisioned for you.
-
Run
terraform-wheels add-package -package=<name>to create a service deployment file. The<name>is the package name as found in DC/OS universe. -
Open
service-<name>.tfand adjust it to your needs -
Deploy your package doing:
terraform-wheels plan -out=plan.out terraform-wheels apply plan.out
-
To remove the package do:
terraform-wheels destroy
ℹ️ This is an experimental feature, please report bugs
The terraform-wheels utility can be used as an interim, drop-in replacement to dcos-wheels in order to help you migrate to Universal Installer.
It can parse configuration YAMLs and create the respective terraform definition, enabling pure terraform interfacing from this point onwards.
| Replace | With |
|---|---|
dcos-wheels -c cluster.yaml create dcos-wheels wait |
terraform-wheels import-cluster cluster.yaml terraform-wheels plan -out=plan.out terraform-wheels apply plan.out |
dcos-wheels describe |
terraform-wheels output -json |
dcos-wheels destroy |
terraform-wheels destroy -auto-approve |