Skip to content

Instantly share code, notes, and snippets.

View mrapczynski's full-sized avatar

Matt Rapczynski mrapczynski

View GitHub Profile
@pofallon
pofallon / awsso.sh
Last active February 12, 2021 22:00
Leverage AWS SSO credentials via credential_process
#! /usr/bin/env bash
CREDS=$(aws sso get-role-credentials --profile $1 \
--output json \
--access-token $(jq -r ".accessToken" $(grep -l "accessToken" ~/.aws/sso/cache/*.json)) \
--account-id $(aws configure get sso_account_id --profile $1) \
--role-name $(aws configure get sso_role_name --profile $1) |
jq '.roleCredentials | {
Version: 1,
AccessKeyId: .accessKeyId,