=tweaks to gcp/tf output

This commit is contained in:
Gal Szkolnik 2022-08-09 12:08:50 -04:00
parent 95a1b2db61
commit cb679f9b01
2 changed files with 7 additions and 6 deletions

View File

@ -44,12 +44,13 @@ function gcp_get_stack() {
"N='$N'; " \
"${_cmd}" \
"echo 'Listing $N stack:'; " \
'{ gcloud compute networks list --filter="name:$N" | ' "sed --unbuffered s/^/Networks.:\ /g ; } " \
'&& { gcloud compute networks subnets list --filter="name:$N" | ' "sed --unbuffered s/^/Subnets..:\ /g ; } " \
'&& { gcloud compute disks list --filter="name:$N" | ' "sed --unbuffered s/^/Disks....:\ /g ; } " \
'&& { gcloud compute instances list --filter="name:$N" | ' "sed --unbuffered s/^/Instances:\ /g ; } " \
'{ gcloud compute networks list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Networks.:\ /g ; } " \
'&& { gcloud compute networks subnets list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Subnets..:\ /g ; } " \
'&& { gcloud compute disks list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Disks....:\ /g ; } " \
'&& { gcloud compute instances list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Instances:\ /g ; } " \
'&& { gcloud compute routers list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Routers..:\ /g ; } " \
'&& { gcloud compute network-firewall-policies get-effective-firewalls --network="$N-network"' \
" | sed --unbuffered s/^/Firewall:\ /g ; } " \
" 2>&1 | sed --unbuffered s/^/Firewall:\ /g ; } " \
) ;}"
[ $# -ge 2 ] && _cmd="watch -n${2} '${_cmd}'"

View File

@ -95,7 +95,7 @@ if [[ -x $TERRAFORM_BIN ]]; then
}
function get-tf-env-plan() {
set | grep '^TF\(_\(VAR_[a-z]\)\|\([A-Z_]TARGET=\)\)' | grep '\b='
set | grep '^TF\(_\(VAR_[a-z]\)\|\([A-Z_]*TARGET=\)\)' | grep '\b='
}
function clear-tf-env-vars() {