Skip to main content

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 default target_account_id to 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 the state account 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 --help for extra help info
  • aws-login login --help Extra help for the login command.
  • aws-login --install-completion Shell completion
  • aws-login list-environments Prints all the envs you have.
  • aws-login list-profiles prints all the profiles you have, so you don't have to cat the config file.

Dev Notes

python -m build twine upload -r pypi dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws_adfs_login_helper-1.0.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_adfs_login_helper-1.0.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

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

Hashes for aws_adfs_login_helper-1.0.1.tar.gz
Algorithm Hash digest
SHA256 75a7a9a9e3efae356e311fe6683d7dcc6041bb41f0aeaca779e824dec4a5d472
MD5 29275b1bb91c7315a7158947e5896c36
BLAKE2b-256 4e73747c6546ad0723b922c4f85fffedd759d74ac2ebea717a4015074ced89cd

See more details on using hashes here.

File details

Details for the file aws_adfs_login_helper-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_adfs_login_helper-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88a841f313a592f0b2707f64cc139c2bfc02892904da729098cd841fce902a33
MD5 fdb0e2b9367828084e47bcbe96cb9660
BLAKE2b-256 a8ef20c4469005dfe9487cc5a249bfea0571483eb42f6968f366fb0fea23d2dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page