2017-11-14 15:36:22 +01:00
|
|
|
function tf_prompt_info() {
|
2020-02-08 03:28:18 +01: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 16:45:25 +01:00
|
|
|
}
|
2020-09-30 10:50:33 +02:00
|
|
|
|
2023-08-16 13:46:28 +02: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 10:50:33 +02:00
|
|
|
alias tf='terraform'
|
2021-06-19 00:17:40 +02:00
|
|
|
alias tfa='terraform apply'
|
2023-02-21 11:23:04 +01:00
|
|
|
alias tfc='terraform console'
|
2021-06-19 00:17:40 +02:00
|
|
|
alias tfd='terraform destroy'
|
|
|
|
alias tff='terraform fmt'
|
|
|
|
alias tfi='terraform init'
|
2022-03-18 13:09:05 +01:00
|
|
|
alias tfo='terraform output'
|
2021-06-19 00:17:40 +02:00
|
|
|
alias tfp='terraform plan'
|
|
|
|
alias tfv='terraform validate'
|
2024-01-13 12:36:26 +01:00
|
|
|
alias tfs='terraform state'
|
|
|
|
alias tfsh='terraform show'
|