OUT=$(aws sts assume-role --role-arn arn:aws:iam::0123456789:role/OrganizationAccountAccessRole --role-session-name test)
export AWS_ACCESS_KEY_ID=$(echo $OUT | cut -d '"' -f 6 )
export AWS_SECRET_ACCESS_KEY=$(echo $OUT | cut -d '"' -f 10 )
export AWS_SESSION_TOKEN=$(echo $OUT | cut -d '"' -f 14 )
aws sts get-caller-identity
AWS Assume to another role

Andrew
Andrew is a visionary software engineer and DevOps expert with a proven track record of delivering cutting-edge solutions that drive innovation at Ataiva.com. As a leader on numerous high-profile projects, Andrew brings his exceptional technical expertise and collaborative leadership skills to the table, fostering a culture of agility and excellence within the team. With a passion for architecting scalable systems, automating workflows, and empowering teams, Andrew is a sought-after authority in the field of software development and DevOps.
Related Articles
How to AWS sts assume role in one command - without jq
Jun 9, 2023 • 0 min read
How to AWS sts assume role in one command - without jq
How to Return a List of All AWS Lambda Function Names in CLI
Feb 24, 2023 • 0 min read
How to Return a List of All AWS Lambda Function Names in CLI
How to Empty and Delete an S3 Bucket using the AWS CLI
Nov 9, 2022 • 0 min read
How to Empty and Delete an S3 Bucket using the AWS CLI
How to create an AWS EC2 instance in CloudFormation
Sep 20, 2022 • 3 min read
How to create an AWS EC2 instance in CloudFormation
Tags
Recent Posts
Macros in Rust: Metaprogramming Made Simple
Apr 5, 2025Concurrency in Rust: Fearless Parallelism
Mar 22, 2025Lifetimes in Rust: Managing References Safely
Mar 15, 2025