mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-11-10 21:41:12 +00:00
[aws] Improve output of aws_cf function
This commit is contained in:
parent
fc8f82329b
commit
cb0099ec7a
@ -114,9 +114,15 @@ function aws_ssm_session_any {
|
|||||||
function aws_cf {
|
function aws_cf {
|
||||||
local profile=$(_get_aws_profile)
|
local profile=$(_get_aws_profile)
|
||||||
|
|
||||||
aws cloudfront list-distributions --profile $profile --output ${_aws_output} \
|
if ! type "jq" > /dev/null; then
|
||||||
|
echo "ERROR: this function needs jq to be installed"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
aws cloudfront list-distributions --profile $profile --output json \
|
||||||
--query "DistributionList.Items[*].{id:Id,domain:DomainName,status:Status,
|
--query "DistributionList.Items[*].{id:Id,domain:DomainName,status:Status,
|
||||||
origin:Origins.Items[].DomainName | join(' ', @), aliases:Aliases.Items | join(' ', @)}"
|
origin:Origins.Items[].DomainName | join(' ', @), aliases:Aliases.Items | join(' ', @)}" \
|
||||||
|
| jq -r ".[] | [.id, .domain, .aliases, .status, .origin] | @csv" | tr -d '"' | column --separator="," --table
|
||||||
}
|
}
|
||||||
|
|
||||||
# ~/.ssh/config
|
# ~/.ssh/config
|
||||||
|
Loading…
Reference in New Issue
Block a user