Name: terraform-intro
Owner: Datadog, Inc.
Description: A small demo project for introducing terraform
Created: 2017-12-01 23:04:44.0
Updated: 2017-12-13 04:35:25.0
Pushed: 2017-12-02 01:44:48.0
Homepage: null
Size: 25
Language: HCL
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A demo project for introducing terraform.
This repo doesn't use a Terraform Backend which is generally a good practice. This repo is for DEMO purposes only.
For Datadog employees, you'll need to have
aws-vault
configured to provision
AWS resources.
This repo expects Terraform Workspaces to be used.
See the example.tfvars file for workspace based variable
definitions that are expected. For the purposes of this document, the workspace
name and filename used for will be default
.
Use terraform workspace select default
to switch to this workspace. The
default.tfvars
should be used with this workspace when executing terraform
commands, e.g. terraform plan -var-file=default.tfvars
. This worksapce is
for the development team to create a one-for-one likeness with production at a
smaller scale to reduce cost.
For a quick rough script for the demo, please look at demo.md; below are instructions on how to work with this terraform configuration template.
terraform workspace select default
. A list of
workspaces can be made available by typing terraform workspace list
.
Remember default
is the development workspace, see the Development (“Default”) section for details.terraform get
to download any modules that are being used in the
configuration.terraform plan -out=plan.out -var-file=<worksapce>.tfvars
- be sure
to use the right <workspace>.tfvars
file; see the Workspaces
section for more details.terraform apply
plan.out
which will apply the plan from the previous step. The variable file
does not need to be supplied again, it is built into the plan output.terraform destroy
-var-file=default.tfvars
though there are times where you may want to plan a
destroy first. To do so, add the -destroy
flag to terraform plan
and then
apply
the destroy plan.MIT; see LICENSE for details.