Skip to main content

Package that helps manage aws credentials

Project description

li-aws-helper

CircleCI

li-aws-helper is a Python library designed to facilitate the management of AWS credentials and the refreshing of session tokens using MFA (Multi-Factor Authentication). This library provides a command-line interface (CLI) to configure AWS credentials and refresh session tokens easily.

Installation

To install the li-aws-helper package, use the following command:

pip3 install li-aws-helper

Configuration

Before using the library, you need to configure your AWS credentials. Run the following command to start the configuration process:

li config

he service will prompt you to provide the following information:

  • Region: The AWS region (default is us-east-1).
  • Access Key: Your AWS access key.
  • Secret Key: Your AWS secret key.
  • MFA Identifier: The ARN of your MFA device.

All those answers you can find at AWS Console/ Security credentials.

Note: The provided credentials will be stored locally in a file named credentials.json.

The library works, modifying your .aws/credentials for the mfa credentials, keeping your original credentials safe. For rollback your original credentials, you can run the command:

li rollback

You shouldn't have to do this, but if you want to rollback the credentials, you can run the command above.

Usage

Refreshing Session Tokens

To refresh your AWS session tokens using MFA, use the following command:

li refresh --token <MFA_TOKEN_CODE>

Replace <MFA_TOKEN_CODE> with the actual MFA token code generated by your MFA device.

You also can add a function to your .bashrc or .bash_profile to make the command shorter:

litoken(){
 li refresh --token $1
}

Then, you can refresh your session tokens by running:

litoken <MFA_TOKEN_CODE>

Local Development

For local development, follow these steps:

  1. Build the project:
poetry build
  1. Install the project:
poetry install
  1. Install twine for publishing:
python3 -m pip install --upgrade twine

FAQ

  • What is an ARN? An ARN (Amazon Resource Name) is a unique identifier for AWS resources.
  • Where can I find my AWS key and secret? You can find your AWS access key and secret key in the AWS Management Console under Security Credentials.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

Contact

For any questions or issues, please contact Alini Ribeiro at aliniribeiroo@gmail.com.

This documentation provides an overview of the li-aws-helper library, including installation, configuration, usage, and development instructions.

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

li_aws_helper-0.4.5.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

li_aws_helper-0.4.5-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file li_aws_helper-0.4.5.tar.gz.

File metadata

  • Download URL: li_aws_helper-0.4.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.11 Linux/6.8.0-1021-aws

File hashes

Hashes for li_aws_helper-0.4.5.tar.gz
Algorithm Hash digest
SHA256 6329aa7feb3e70bc56b61a419906491f202690eb5211587646b5f643cccc5b58
MD5 7cef92d6cf6fdf9961428dd8eb08df84
BLAKE2b-256 1130cab1fa9489ce40345aa476709d1203e05118cbda4331bdc136188ac0b3a8

See more details on using hashes here.

File details

Details for the file li_aws_helper-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: li_aws_helper-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.11 Linux/6.8.0-1021-aws

File hashes

Hashes for li_aws_helper-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4e3a4696d1b995e9f0200419f83cf21f7b30dab45d22f94c5ad5fa5efaaff6a0
MD5 67dc2e3c1e8779e71084fe510d3161c9
BLAKE2b-256 b20b80a9fae224ee40e7cf10f94083ee233f347a9f267c9f06d7c8791a7a09e6

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