more funcs
This commit is contained in:
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
|
||||
}
|
||||
Reference in New Issue
Block a user