zsh: add aws-get-bedrock-profile
This commit is contained in:
17
zsh/.local/share/zsh/functions/aws-get-bedrock-profile
Normal file
17
zsh/.local/share/zsh/functions/aws-get-bedrock-profile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
aws-get-bedrock-profile () {
|
||||||
|
profile_arn=$(aws bedrock list-inference-profiles \
|
||||||
|
| jq -r '.inferenceProfileSummaries
|
||||||
|
| map(select(.inferenceProfileId | startswith("us.")))
|
||||||
|
| sort_by(.inferenceProfileName)
|
||||||
|
| .[]
|
||||||
|
| [.inferenceProfileArn, .inferenceProfileName, .description]
|
||||||
|
| @tsv' \
|
||||||
|
| fzf \
|
||||||
|
--header="$(printf '%-30s\t%s\n' 'NAME' 'DESCRIPTION')" \
|
||||||
|
--no-preview \
|
||||||
|
--delimiter='\t' \
|
||||||
|
--with-nth=2,3 \
|
||||||
|
| awk '{print $1}')
|
||||||
|
[[ -z "$profile_arn" ]] && return 1
|
||||||
|
echo "$profile_arn"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user