more funcs
This commit is contained in:
parent
a474758772
commit
fc1cddac13
14
zsh/.local/share/zsh/functions/aws-list-records
Normal file
14
zsh/.local/share/zsh/functions/aws-list-records
Normal file
@ -0,0 +1,14 @@
|
||||
aws-list-records() {
|
||||
# list route53 hosted zone ids and names, select the zone id using fzf
|
||||
local zone_id
|
||||
zone_id=$(aws route53 list-hosted-zones \
|
||||
| jq -r '.HostedZones[] | "\(.Id | split("/")[2]) \(.Name)"' \
|
||||
| fzf --header="$(printf '%-21s %s' 'Zone ID' 'Name')" \
|
||||
| awk '{print $1}')
|
||||
|
||||
[[ -z "$zone_id" ]] && return 1
|
||||
|
||||
printf "# zone id: %s\n" "$zone_id"
|
||||
aws route53 list-resource-record-sets --hosted-zone-id "$zone_id" | \
|
||||
jq -r '.ResourceRecordSets[] | "\(.Name)\t\(.Type)\t\(.ResourceRecords[]?.Value)"'
|
||||
}
|
||||
3
zsh/.local/share/zsh/functions/aws-logout
Normal file
3
zsh/.local/share/zsh/functions/aws-logout
Normal file
@ -0,0 +1,3 @@
|
||||
aws-logout() {
|
||||
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_ENVIRONMENT
|
||||
}
|
||||
@ -88,9 +88,9 @@ if [ -e $HOME/cfa-work/.zshrc ]; then
|
||||
. $HOME/cfa-work/.zshrc
|
||||
fi
|
||||
|
||||
for env in $HOME/.okta/.env $HOME/.config/aws/.env $HOME/.config/github/.env $HOME/.config/aichat/.env; do
|
||||
if [ -r $env ]; then
|
||||
export $(xargs < $env)
|
||||
for env in $HOME/.config/*/.env; do
|
||||
if [ -r "$env" ]; then
|
||||
export $(xargs < "$env")
|
||||
fi
|
||||
done
|
||||
|
||||
@ -131,5 +131,3 @@ zstyle :compinstall filename '~/.zshrc'
|
||||
#zstyle :compinstall filename '~/.zshrc'
|
||||
|
||||
#compinit
|
||||
|
||||
complete -o nospace -C /home/cli/dotfiles/zsh/.local/bin/tofu tofu
|
||||
|
||||
Loading…
Reference in New Issue
Block a user