Skip to content

Instantly share code, notes, and snippets.

@elblivion
Created February 16, 2016 10:23
Show Gist options
  • Save elblivion/08ba0031947ee2a44933 to your computer and use it in GitHub Desktop.
Save elblivion/08ba0031947ee2a44933 to your computer and use it in GitHub Desktop.
terraform-modules/tests/Makefile
default: test
test: plan clean
@echo "Ran plan check"
integration: build destroy
@echo "Ran integration test"
plan:
terraform version
terraform get
terraform plan -module-depth=1
build: plan
terraform apply
terraform plan -module-depth=1 -detailed-exitcode
destroy:
# taint workaround for ASGs, to be removed once the issues around
# create_before_destroy cycles are solved
terraform taint -module cma_worker_asg aws_autoscaling_group.fixed_asg
terraform taint -module cma_worker_asg aws_launch_configuration.fixed_asg
terraform taint -module cda_autoscaling aws_autoscaling_group.cda_asg
terraform taint -module cda_autoscaling aws_launch_configuration.cda_autoscaling
terraform taint -module coreos_ecs_asg aws_autoscaling_group.fixed_asg
terraform taint -module coreos_ecs_asg aws_launch_configuration.fixed_asg
# destroy all resources and delete state
terraform destroy -force && rm -f terraform.tfstate
clean:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment