https://github.com/dedoussis/aws-assume-role
Zsh script for assuming an AWS IAM role using MFA authentication
https://github.com/dedoussis/aws-assume-role
aws iam-credentials iam-role mfa script zsh
Last synced: 11 months ago
JSON representation
Zsh script for assuming an AWS IAM role using MFA authentication
- Host: GitHub
- URL: https://github.com/dedoussis/aws-assume-role
- Owner: dedoussis
- Created: 2018-04-22T17:02:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-24T06:29:24.000Z (about 8 years ago)
- Last Synced: 2025-04-01T03:41:24.670Z (about 1 year ago)
- Topics: aws, iam-credentials, iam-role, mfa, script, zsh
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Assume IAM role script for AWS
As a user of an AWS account, use this zsh script to assume any given IAM role within the account.
Includes step of MFA authentication.
## Usage
``` bash
# Replace {role} with the ARN of the target IAM role.
# Then run:
role_arn={role} source aws_assume_role.sh
```
Script will export `AWS_ACCESS_KEY`, `AWS_SECRET_ACCESS_KEY` and `AWS_SESSION_TOKEN` in the current shell.
## Background
Further info on temporary security credentials can be found [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html).