[go: up one dir, main page]

Today I Learned

tags


2022/04/04

to run terraform output $output_name to print a named output


2022/10/11

That terraform plan -detailed-exitcode exists: 0 means no diff, 1 means error, 2 means a diff exists.

Also, that you can print the source code of a bash function like so:

print_fn_src() { declare -f "$1"; }

2022/10/18

That BSD arch command found on Macs also supports a -${arch} flag for running universal binaries.


2022/10/24

That you can list all addresses in terraform state by running

terraform state list

Docs at https://developer.hashicorp.com/terraform/cli/commands/state/list


Also, that compgen -v is a function, at least on Mac zsh. Apparently in zsh compgen -v calls something like

for var_name in "${(k)parameters[@]}"; do
  printf '%s\n' "$var_name"
done

which is the first time I’ve seen that kind of shell syntax. It generates a bad substitution message in bash 3.2, so I can only assume it’s zsh-specific.


2023/01/30

That psql et al. support colors:

export PG_COLOR=auto # only colorize output to ttys

learned from https://fluca1978.github.io/2023/01/23/PostgreSQLColors.html See also:


2024/03/26

That you can specify an alternate .terraformrc file using the environment variable TF_CLI_CONFIG_FILE=$ABSOLUTE_PATH. This can help with local provider development. See https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_cli_config_file