Skip to content

Instantly share code, notes, and snippets.

@HauptJ
Created March 23, 2026 23:31
Show Gist options
  • Select an option

  • Save HauptJ/107023f40e22a3c536ad8a3f80065fe0 to your computer and use it in GitHub Desktop.

Select an option

Save HauptJ/107023f40e22a3c536ad8a3f80065fe0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
secret_id=$1
aws_bin_path="/snap/bin/aws"
secret_val=$(${aws_bin_path} secretsmanager get-secret-value --secret-id ${secret_id} --query SecretString --output text | jq '.[]')
return_code=$?
if [ "$return_code" -eq 0 ]; then
echo $secret_val
return 0
else
return $return_code
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment