Terraform convenience functions and aliases for ZSH
Depending on your ZSH plugin framework, add the following to your .zshrc
:
zplug "pbar1/zsh-terraform"
zgen load pbar1/zsh-terraform
antigen bundle pbar1/zsh-terraform
This is the entire source, I think it speaks for itself:
alias tf=terraform
alias tfw="terraform workspace"
tfv(){
terraform validate -var-file=vars/$(terraform workspace show).tfvars
}
tfp(){
terraform plan -var-file=vars/$(terraform workspace show).tfvars
}
tfa(){
terraform apply -var-file=vars/$(terraform workspace show).tfvars
}
tfc(){
terraform console -var-file=vars/$(terraform workspace show).tfvars
}