2017-11-14 14:36:22 +00:00
|
|
|
function tf_prompt_info() {
|
2020-02-08 02:28:18 +00:00
|
|
|
# dont show 'default' workspace in home dir
|
|
|
|
[[ "$PWD" != ~ ]] || return
|
|
|
|
# check if in terraform dir and file exists
|
|
|
|
[[ -d .terraform && -r .terraform/environment ]] || return
|
|
|
|
|
|
|
|
local workspace="$(< .terraform/environment)"
|
|
|
|
echo "${ZSH_THEME_TF_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TF_PROMPT_SUFFIX-]}"
|
2017-11-07 15:45:25 +00:00
|
|
|
}
|
2020-09-30 08:50:33 +00:00
|
|
|
|
2023-08-16 11:46:28 +00:00
|
|
|
function tf_version_prompt_info() {
|
|
|
|
local terraform_version
|
|
|
|
terraform_version=$(terraform --version | head -n 1 | cut -d ' ' -f 2)
|
|
|
|
echo "${ZSH_THEME_TF_VERSION_PROMPT_PREFIX-[}${terraform_version:gs/%/%%}${ZSH_THEME_TF_VERSION_PROMPT_SUFFIX-]}"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-09-30 08:50:33 +00:00
|
|
|
alias tf='terraform'
|
2021-06-18 22:17:40 +00:00
|
|
|
alias tfa='terraform apply'
|
2024-11-05 23:51:01 +00:00
|
|
|
alias tfa!='terraform apply -auto-approve'
|
2023-02-21 10:23:04 +00:00
|
|
|
alias tfc='terraform console'
|
2021-06-18 22:17:40 +00:00
|
|
|
alias tfd='terraform destroy'
|
2024-10-03 12:34:30 +00:00
|
|
|
alias 'tfd!'='terraform destroy -auto-approve'
|
2021-06-18 22:17:40 +00:00
|
|
|
alias tff='terraform fmt'
|
2024-09-05 17:52:39 +00:00
|
|
|
alias tffr='terraform fmt -recursive'
|
2021-06-18 22:17:40 +00:00
|
|
|
alias tfi='terraform init'
|
2024-06-10 23:29:57 +00:00
|
|
|
alias tfiu='terraform init -upgrade'
|
2022-03-18 12:09:05 +00:00
|
|
|
alias tfo='terraform output'
|
2021-06-18 22:17:40 +00:00
|
|
|
alias tfp='terraform plan'
|
|
|
|
alias tfv='terraform validate'
|
2024-01-13 11:36:26 +00:00
|
|
|
alias tfs='terraform state'
|
2024-03-26 08:52:01 +00:00
|
|
|
alias tft='terraform test'
|
2024-01-13 11:36:26 +00:00
|
|
|
alias tfsh='terraform show'
|