Skip to content

Instantly share code, notes, and snippets.

@brainsik
Created January 22, 2021 01:53
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 brainsik/c772c142153f1ba55cf6a1d6ba760365 to your computer and use it in GitHub Desktop.
Save brainsik/c772c142153f1ba55cf6a1d6ba760365 to your computer and use it in GitHub Desktop.
Installs the AWS Terraform provider to your local plugins directory
#!/bin/sh
set -eu -o pipefail
set -x
version=$1
cd terraform-provider-aws
git fetch
git checkout .
git checkout "v$version"
cd tools
go get -d github.com/pavius/impi/cmd/impi
cd ..
make tools
make build
plugin_dir="$HOME/.terraform.d/plugins/registry.terraform.io/hashicorp/aws/$version/darwin_arm64"
mkdir -p "$plugin_dir"
cp -v "$GOPATH/bin/terraform-provider-aws" "$plugin_dir/terraform-provider-aws_v${version}_x5"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment