Skip to content

Instantly share code, notes, and snippets.

@datfinesoul
Created June 22, 2021 03:46
Show Gist options
  • Save datfinesoul/0635049e81d3d73ed9c7a5d677851d22 to your computer and use it in GitHub Desktop.
Save datfinesoul/0635049e81d3d73ed9c7a5d677851d22 to your computer and use it in GitHub Desktop.
Drift Makefile
SHELL=/bin/bash
scan:
@driftctl scan \
--from "tfstate+tfcloud://$(shell <".tfcloud/.wsid" cat)" \
--tfc-token "$(shell <"${HOME}/.terraform.d/credentials.tfrc.json" jq -r '.credentials."app.terraform.io".token')"
ignore:
@driftctl scan \
--from "tfstate+tfcloud://$(shell <".tfcloud/.wsid" cat)" \
--tfc-token "$(shell <"${HOME}/.terraform.d/credentials.tfrc.json" jq -r '.credentials."app.terraform.io".token')" \
--output json://drift.json \
|| true
driftctl gen-driftignore --input drift.json > .driftignore
clean:
rm -f drift.json .driftignore
.PHONY: scan ignore clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment