Skip to content

Instantly share code, notes, and snippets.

View tonys-code-base's full-sized avatar

Tony Tannous tonys-code-base

View GitHub Profile
@tonys-code-base
tonys-code-base / refresh_sts_creds.sh
Last active October 16, 2022 06:15
Refresh/Set credentials generated from aws-sts-assume-role-saml for AWS CLI profile
profilename=$1
principal_arn=$2
role_arn=$3
saml_assertion_path=$4
sts_credentials=$(aws sts assume-role-with-saml \
--principal-arn $principal_arn \
--role-arn $role_arn \
--saml-assertion \
file:\/\/$saml_assertion_path)