Is this for you?
Ever found yourself frantically juggling multiple AWS accounts, desperately trying to remember which set of credentials goes where? Or maybe you’re fed up with always having to deal with expired credentials. Gone are the days of having permanent credentials saved everywhere. It’s unsafe! There has to be a better way. Well, fret no more, because the all new open source project get-tmp-creds is here to save the day—and your sanity.
What Is This Sorcery?
This Python-based CLI tool is your new best friend when it comes to managing AWS credentials. It streamlines the process of logging in via AWS SSO, fetching temporary credentials, and even exporting them as environment variables or saving them to your ~/.aws/credentials
file.
Gone are the days of manually updating credentials or accidentally overwriting them with a copy-paste error at 2 AM. Whether you’re a developer who needs to switch roles faster than a superhero, a DevOps engineer automating your CI/CD pipelines, or an AWS administrator managing the chaos of temporary credentials, this tool is designed with you in mind.
Links
Github: https://github.com/aderbique/get-tmp-creds
PyPi: https://pypi.org/project/get-tmp-creds
Features: Why You’ll Love It
- List Configured Profiles: No more squinting at your
~/.aws/config
file. This tool will list all your configured profiles so you can choose the right one with ease. - Login and Fetch Credentials: Log in to AWS SSO, grab those sweet, sweet temporary credentials, and export them as environment variables. It’s as easy as ordering pizza online—only healthier.
- Save Credentials: Save your credentials to
~/.aws/credentials
for persistent use, because who has time to do that manually? - Profile-based Configuration: Keep your credentials neat and organized by saving them under the specific profile you need.
- Conditional Default Profile Handling: If the default profile already exists, the tool asks, “Are you sure about this?” and only overwrites it if you say so.
- Logging: Detailed logging helps you track the process and figure out where things went south—because we all know that debugging is half the fun.
Prerequisites: The Bare Minimum
Before you dive into the awesomeness, make sure you have:
- AWS CLI: The backbone of this tool. Ensure it’s installed and configured with valid credentials. Think of it as the peanut butter to this tool’s jelly.
- AWS SSO Configuration: Your
~/.aws/config
file should be in tip-top shape, with the AWS account you want to access all set up. If it’s not, don’t worry—there’s an example in the repository to get you started.
Installation: Get It While It’s Hot
If you have Python 3.x installed, you’re just one command away from simplifying your AWS life:
pip install get-tmp-creds
Usage: Credentials on Demand
- List Profiles:
get-tmp-creds --list
- Get and Save Credentials:
get-tmp-creds my-dev-acct
- Get Credentials Without Saving:
get-tmp-creds my-dev-acct --no-save
- Set Default Profile:
get-tmp-creds my-dev-acct --set-default
Troubleshooting: Because Nothing’s Perfect
Encounter an UnauthorizedException
or an ExpiredToken
error? It might be time to re-authenticate with aws sso login
. And if things still aren’t working, the tool’s detailed logging has got your back. Think of it as a breadcrumb trail leading you back to AWS harmony.
Contributing: Join the Fun
Found a bug? Have a feature request? Want to contribute code? We’re all ears! This project is licensed under the MIT License, so feel free to fork, modify, and make it your own.
Final Thoughts: Why Haven’t You Installed It Yet?
The AWS Temporary Credentials CLI is the tool you didn’t know you needed, but now can’t live without. It’s here to make your AWS experience smoother, faster, and—dare we say it—more enjoyable. So, go ahead, give it a spin, and say goodbye to credential chaos. Your future self will thank you.