diff --git a/zsh/.local/share/zsh/functions/aws-get-bedrock-profile b/zsh/.local/share/zsh/functions/aws-get-bedrock-profile new file mode 100644 index 0000000..75da12f --- /dev/null +++ b/zsh/.local/share/zsh/functions/aws-get-bedrock-profile @@ -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" +}