Skip to main content

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/*

Metadata

Release files for aws-adfs-login-helper 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-adfs-login-helper 1.0.1
File Size Uploaded Provenance
aws_adfs_login_helper-1.0.1.tar.gz 7.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aws-adfs-login-helper 1.0.1
File Interpreter ABI Platform
aws_adfs_login_helper-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / aws_adfs_login_helper-1.0.1.tar.gz

Download URL aws_adfs_login_helper-1.0.1.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
75a7a9a9e3efae356e311fe6683d7dcc6041bb41f0aeaca779e824dec4a5d472
BLAKE2b-256 checksum
How to use checksums
4e73747c6546ad0723b922c4f85fffedd759d74ac2ebea717a4015074ced89cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / aws_adfs_login_helper-1.0.1-py3-none-any.whl

Download URL aws_adfs_login_helper-1.0.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88a841f313a592f0b2707f64cc139c2bfc02892904da729098cd841fce902a33
BLAKE2b-256 checksum
How to use checksums
a8ef20c4469005dfe9487cc5a249bfea0571483eb42f6968f366fb0fea23d2dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Security for aws-adfs-login-helper 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page