AWS Login Tool - ADFS authentication with YAML configuration
Project description
aws-login
A python util to assist with logging into AWS via aws-adfs tool.
Usage
Install
- Install via
pip
pip install aws-adfs-login-helper
Config
- All config will be in
$HOME/.config/aws-login.yaml
profiles:
eu:
region: eu-west-1
username: "aws\\me"
adfs-host: adfs.hostname
us:
region: us-east-1
username: "aws\\me"
adfs-host: "adfs.com"
environments:
dev:
state_account_id: "12312312312"
target_account_id: "12512512512"
session_duration: 900
tf-stage:
state_account_id: "5215125125125"
target_account_id: "621612612612"
session_duration: 900
prod:
state_account_id: "4124152186221"
defaults:
role_name: "ROLE-Root"
session_duration: 900
ssl:
ca_bundle_path: "~/.ssh/aws_certs/eu.pem"
verify_ssl: true
state_account_id= Where the terraform state is located, if this is the only value set will defaulttarget_account_idto be the same.target_account_id= The target for our terraform. If you have state in a shared account you want to use shared as thestateaccount and the target as well.. the target.
Login
- Since most times you will need to enter your ADFS password for the first time of the day, you should call the tool like this for the initial invocation for the day.
- As a result you need to login without exporting the variables
aws-login -e dev
-
This will call aws-adfs and ask for your password / 2FA etc.
-
For actual usage you want to call it as so:
eval $(aws-login login -e prod)
- As we have already authed to adfs we can just run this and trust our variables get exported.
Extras
aws-login --helpfor extra help infoaws-login login --helpExtra help for thelogincommand.aws-login --install-completionShell completionaws-login list-environmentsPrints all the envs you have.aws-login list-profilesprints all the profiles you have, so you don't have tocatthe config file.
Dev Notes
python -m build twine upload -r pypi dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aws_adfs_login_helper-1.0.1.tar.gz.
File metadata
- Download URL: aws_adfs_login_helper-1.0.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a7a9a9e3efae356e311fe6683d7dcc6041bb41f0aeaca779e824dec4a5d472
|
|
| MD5 |
29275b1bb91c7315a7158947e5896c36
|
|
| BLAKE2b-256 |
4e73747c6546ad0723b922c4f85fffedd759d74ac2ebea717a4015074ced89cd
|
File details
Details for the file aws_adfs_login_helper-1.0.1-py3-none-any.whl.
File metadata
- Download URL: aws_adfs_login_helper-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88a841f313a592f0b2707f64cc139c2bfc02892904da729098cd841fce902a33
|
|
| MD5 |
fdb0e2b9367828084e47bcbe96cb9660
|
|
| BLAKE2b-256 |
a8ef20c4469005dfe9487cc5a249bfea0571483eb42f6968f366fb0fea23d2dd
|