Skip to main content

Login to AWS SSO with this simple utility - just invoke get_aws_session with: region, role_name, account_id, sso_endpoint. Then use the returned aws session instead of boto3

Project description

sso-aws - AWS SSO Login Utility 🔒

License

Overview 📝

The AWS SSO Login Utility is a Python package that simplifies the process of logging in to AWS Single Sign-On (SSO) and retrieving an AWS session for programmatic access. With just a single function call, get_aws_session, you can easily obtain an AWS session to use instead of boto3.

Installation 🚀

You can install the package via pip:

pip install sso-aws

Usage 💻

To use the utility, follow these steps:

  1. Import the package:

    from aws_sso_login import get_aws_session
    
  2. Invoke the get_aws_session function with the required parameters:

    session = get_aws_session(region='us-west-2', role_name='MyRole', account_id='123456789012', sso_endpoint='https://example.awsapps.com/start')
    

    Make sure to provide the correct values for region, role_name, account_id, and sso_endpoint.

  3. Now you can use the returned session object instead of boto3 to interact with AWS services:

    # Example: List S3 buckets
    s3_client = session.client('s3')
    response = s3_client.list_buckets()
    print(response['Buckets'])
    

Example 📃

Here's an example that demonstrates how to use the utility:

from aws_sso_login import get_aws_session

region = 'us-west-2'
role_name = 'MyRole'
account_id = '123456789012'
sso_endpoint = 'https://example.awsapps.com/start'

session = get_aws_session(region=region, role_name=role_name, account_id=account_id, sso_endpoint=sso_endpoint)

# Use the session object for AWS API calls
s3_client = session.client('s3')
response = s3_client.list_buckets()
print(response['Buckets'])

Contributing 👥

Contributions are welcome! If you find any issues or want to enhance this utility, please submit an issue or a pull request in the GitHub repository.

License 📜

This project is licensed under the MIT License.

Acknowledgements 👏

This utility was inspired by the need for a simpler way to log in to AWS SSO and retrieve AWS sessions programmatically. Special thanks to all the contributors and the open-source community.

Contact ✉️

If you have any questions, suggestions, or feedback, feel free to reach out to the project maintainer at GitHub


Enjoy using the AWS SSO Login Utility! ✨

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

sso-aws-1.0.4.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

sso_aws-1.0.4-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file sso-aws-1.0.4.tar.gz.

File metadata

  • Download URL: sso-aws-1.0.4.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.1

File hashes

Hashes for sso-aws-1.0.4.tar.gz
Algorithm Hash digest
SHA256 44ca4a3de1fcc2a9363890ad4f8ddf8f05549630e6838c528d068a4080ec4d07
MD5 f973fddba3640bd7c4ee9d01f5454695
BLAKE2b-256 855ac0cbd579851ad636d40eb38773621a5fc477668af86add2f1c906d51a838

See more details on using hashes here.

File details

Details for the file sso_aws-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: sso_aws-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.1

File hashes

Hashes for sso_aws-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1c04e9b249ea008acaea0ad263d8e66944d942aa64d1decac5de1f6d03ad87
MD5 9ae0e213a42f0c349e0a6173dd408de1
BLAKE2b-256 d8fe19e7688f2a682d93dc2adf3a86c8bce96cc90c1f90c16945acff11445685

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