Skip to content

Instantly share code, notes, and snippets.

@genyrosk
Created November 3, 2022 19:03
Show Gist options
  • Save genyrosk/6aceceff2caf9ee4c540a84afe5c93f6 to your computer and use it in GitHub Desktop.
Save genyrosk/6aceceff2caf9ee4c540a84afe5c93f6 to your computer and use it in GitHub Desktop.
AWS cli aliases
# put into .aws/cli/alias
[toplevel]
get-secret =
!f() {
default_region=$(aws configure get region)
printf "Enter the ARN of the secret: "
read secret_arn
secret_arn=$(echo $secret_arn | xargs)
printf "Enter the Region (default is ${default_region}): "
read region
region="${region:-${default_region}}"
echo ""
aws secretsmanager get-secret-value --secret-id ${secret_arn} --region ${region} --output yaml --no-cli-pager
}; f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment