Skip to content

Execute commands across multiple AWS accounts available via single sign-on

License

Notifications You must be signed in to change notification settings

sbougerel/ssorepeat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssorepeat

Execute commands across multiple AWS accounts available via single sign-on (SSO).


Usage:

ssorepeat [--help] [--profile PROFILE] [FILTERS] [COMMAND [ARGS]]

Repeats execution of COMMAND across AWS accounts selected via FILTERS when logged in a Single Sign-On (SSO) session. Use --profile PROFILE to select session credentials for botocore.session. ssorepeat writes the results of COMMAND as a JSON on the standard output.

Example

aws --profile some-profile sso login
ssorepeat --profile some-profile \
  --include-only "\b[Dd]emo\b" \
  exec aws s3 ls

After SSO login, ssorepeat will run aws s3 ls in accounts whose name contains the word "Demo" or "demo", using the default SSO role setup for this profile.

Installation

Get poetry:

curl -sSL https://install.python-poetry.org | python3 -

Add it to your $PATH then proceed into the repository:

poetry build
pip install .
cp bin/ssorepeat ~/.local/bin

If you don't like to pollute your own local python environment and only need it temporarily, a quick and dirty way is to move bin/ssorepeat to the repository's root and renaming it:

cp bin/ssorepeat ssorepeat.sh
chmod a+x ssorepeat.sh
./assorepeat.sh --help

Documentation

ssorepeat --help

ssorepeat is free software provided as-is under the terms of the Apache License, version 2.0. This software and its authors are not affiliated to AWS.

About

Execute commands across multiple AWS accounts available via single sign-on

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages