Skip to content

Instantly share code, notes, and snippets.

@mtpereira
Last active November 9, 2016 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtpereira/f18ea33727b05c06c6e9399d3cdd6093 to your computer and use it in GitHub Desktop.
Save mtpereira/f18ea33727b05c06c6e9399d3cdd6093 to your computer and use it in GitHub Desktop.
terraform ejson
TARGETS = get plan apply clean destroy
.PHONY: $(TARGETS)
EJSON = ejson --keydir ~/.ejson/keys
get:
terraform get
variables.tfvars: variables.tfvars.ejson
$(EJSON) decrypt varaiables.tfvars.ejson -o variables.tfvars
plan: get variables.tfvars
terraform plan -var-file variables.tfvars -out plan
apply:
terraform apply variables.plan
destroy: get variables.tfvars
terraform destroy -var-file variables.tfvars
clean:
rm -f variables.tfvars plan
{
"_public_key": "__OUTPUT_FROM_EJSON_KEYGEN__",
"foo": "bar"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment