Skip to content

Instantly share code, notes, and snippets.

@philips
Created May 12, 2017 23:34
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 philips/04199c1647670eb451af2c2686a91b8a to your computer and use it in GitHub Desktop.
Save philips/04199c1647670eb451af2c2686a91b8a to your computer and use it in GitHub Desktop.
machine parseable Terraform plan
$ export TERRAFORM_CONFIG=.terraformrc; $HOME/Downloads/tectonic/tectonic-installer/darwin/terraform plan -var-file terraform.tfvars -out bar -state terraform.tfstate ./platforms/aws
$ go get github.com/philips/tfjson
$ tfjson bar
{
...secrets and stuff...
"vpc": {
"destroy": false
},
"workers": {
"aws_autoscaling_group.workers": {
"desired_capacity": "2",
"destroy": false,
"destroy_tainted": false
},
"destroy": false
}
}
@philips
Copy link
Author

philips commented May 12, 2017

The cool thing is I scaled my ASG to 1 and you can see the plan will move it back to 2. See line #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment