install.fairie/home/dot_config/desk/desks/tf.sh

22 lines
504 B
Bash
Raw Normal View History

2023-08-06 22:19:59 -07:00
# tf.sh
#
# Description: desk for doing work on a terraform-based repository
#
cd ~/terraform-repo
# Set up AWS env variables: <key id> <secret>
set_aws_env() {
export AWS_ACCESS_KEY_ID="$1"
export AWS_SECRET_ACCESS_KEY="$2"
}
# Run `terraform plan` with proper AWS var config
plan() {
terraform plan -module-depth=-1 \
-var "access_key=${AWS_ACCESS_KEY_ID}" \
-var "secret_key=${AWS_SECRET_ACCESS_KEY}"
}
# Run `terraform apply` with proper AWS var config
alias apply='terraform apply'