Installation
driftctl is available on Linux, macOS and Windows.
Binaries are available in the release page.
- Manual
- Docker
- Homebrew
- Macports
- Linux / macOS
- Windows
This is an example using curl
. If you don't have curl
, install it, or use wget
.
# Linux
# x64
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_linux_amd64 -o driftctl
# x86
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_linux_386 -o driftctl
# macOS
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_darwin_amd64 -o driftctl
Make the binary executable:
$ chmod +x driftctl
Optionally install driftctl to a central location in your PATH
:
# use any path that suits you, this is just a standard example. Install sudo if needed.
$ sudo mv driftctl /usr/local/bin/
Verify checksum
# Download binary and checksums
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_linux_amd64 -o driftctl_linux_amd64
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_SHA256SUMS -o driftctl_SHA256SUMS
# Verify checksum
$ sha256sum --ignore-missing -c driftctl_SHA256SUMS
driftctl_linux_amd64: OK
# x64
$ curl https://github.com/snyk/driftctl/releases/latest/download/driftctl_windows_amd64.exe -o driftctl.exe
# x86
$ curl https://github.com/snyk/driftctl/releases/latest/download/driftctl_windows_386.exe -o driftctl.exe
You can use also our official Docker image from the terminal.
$ docker run -t --rm \
-v ~/.aws:/root/.aws:ro \
-v $(pwd):/app:ro \
-v ~/.driftctl:/root/.driftctl \
-e AWS_PROFILE=non-default-profile \
snyk/driftctl scan
-v ~/.aws:/root/.aws:ro
(optionally) mounts your ~/.aws
containing AWS credentials and profile
-v $(pwd):/app:ro
(optionally) mounts your working dir containing the terraform state
-v ~/.driftctl:/root/.driftctl
(optionally) prevents driftctl to download the provider at each run
-e AWS_PROFILE=your_profile
(optionally) exports the non-default AWS profile name to use
snyk/driftctl:<VERSION_TAG>
run a specific driftctl tagged release
Usage examples
# With a local state
$ docker run -t --rm \
-v $(pwd):/app:ro \
-v ~/.driftctl:/root/.driftctl \
-e AWS_ACCESS_KEY_ID=XXXXXXXX \
-e AWS_SECRET_ACCESS_KEY=XXXX \
snyk/driftctl scan
# With state stored on a s3 backend
$ docker run -t --rm \
-v $(pwd):/app:ro \
-v ~/.driftctl:/root/.driftctl \
-e AWS_ACCESS_KEY_ID=XXXXXXXX \
-e AWS_SECRET_ACCESS_KEY=XXXX \
snyk/driftctl scan --from tfstate+s3://my-bucket/path/to/state.tfstate
# With multiple states
$ docker run -t --rm \
-v $(pwd):/app:ro \
-v ~/.driftctl:/root/.driftctl \
-e AWS_ACCESS_KEY_ID=XXXXXXXX \
-e AWS_SECRET_ACCESS_KEY=XXXX \
snyk/driftctl scan --from tfstate://terraform_S3.tfstate --from tfstate://terraform_VPC.tfstate
# Using a named profile
$ docker run -t --rm \
-v ~/.aws:/root/.aws:ro \ # mount your aws config folder
-v $(pwd):/app:ro \
-v ~/.driftctl:/root/.driftctl \
-e AWS_PROFILE=your-profile \
snyk/driftctl scan
Homebrew is a free and open-source package management system for Mac OS X. Install the official driftctl formula from the terminal.
$ brew install driftctl
MacPorts is an easy to use system for compiling, installing, and managing open source software. Install the community port from the terminal.
$ sudo port install driftctl