Git Product home page Git Product logo

awscli-sso-config-creator's Introduction

awscli-sso-config-creator

Adapted from this script.

This script will scrape your roles from AWS SSO and create a AWS CLI v2 config file for you.

Requirements

Create virtualenv

$ python -m venv .venv
$ source .venv/bin/activate

Install dependencies

$ pip install -r requirements.txt

For further development -

$ pip install -r requirements-dev.txt

Usage:

  1. Clone this repository
  2. Copy and paste the AWS SSO primary profile credentials from the sample_sso_config profile to your ~/.aws/config file
  3. Login to AWS SSO aws sso login --profile primary
  4. Execute the script python create_sso_config.py
  5. Transfer contents of newly generated sso_config into your ~/.aws/config file

Dependencies

The script relies on a couple of things:

  1. That you have aws cli v2 installed, python3 installed and boto3 library installed for python.
  2. That you have configured your primary SSO profile [profile primary] in ~/.aws/config file
  3. That you have already logged into AWS SSO using aws sso login --profile primary.

Further reading

Boto3 SDK for SSO: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sso.html

AWS CLI v2 SSO configuration: https://docs.amazonaws.cn/en_us/cli/latest/userguide/cli-configure-sso.html

AWS CLI V2 announcement post: https://aws.amazon.com/blogs/developer/aws-cli-v2-is-now-generally-available/

awscli-sso-config-creator's People

Contributors

charleneleong-ai avatar

Stargazers

 avatar

Watchers

 avatar  avatar

awscli-sso-config-creator's Issues

SSO Account 가 많아지니 전체 계정 정보를 가져오지 못합니다.

def get_sso_account_list(sso_region, login):
sso = boto3.client("sso", region_name=sso_region)
""" :type: pyboto3.sso """

list_accounts = sso.list_accounts(
    accessToken=login["accessToken"],
    maxResults=999
)
print(list_accounts)
return list_accounts["accountList"]

SSO Account 가 많아지니 페이지가 짤립니다.
maxResults=?? 추가 필요.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.