semvec/pypi-packages huggingface dataset:
aws-mfa-profiles 2.0.0
A package to create credential for AWS using MFA and with the support of multiple profiles
License: MIT

# aws-mfa-profiles
A package to create credential for AWS using MFA and with the support of multiple profiles

This package wants to simplify the connection to AWS using the MFA supporting also the possibility to use yours profiles.

## Installation
____
You can install the package using `pip install aws-mfa-profiles`.

## Usage
---
There is a little help function callable with `aws-mfa-profiles -h` that it shows this:
```
usage: aws-mfa-profiles [-h] [-p profile] [-t seconds]

Set credential to connect on AWS using MFA

optional arguments:
  -h, --help  show this help message and exit
  -p profile  Profile from which get mfa configuration
  -t seconds  Token expiration time in second from 900 (15 minutes) to 129600 (36 hours) (default: 43200)
```
I set default value for the expiration time session which is `43200` for the expiration time session, this means that the default section is valid for 12 hours. Take in mind that if you use the AWS owner account (root), you can set the session time at maximum at `3600` seconds.

## How does it works?
---
The package read from your `${HOME}/.aws/credentials` file the accounts that you specified and generate a new section in the same file named `${profile_name_selected/choosed}-mfa` with the credentials generated.
Then, you need to define this new account as default for the profiles that you have on `${HOME}/.aws/config`

_credentials_:
```ini
[account_one]
aws_access_key_id = YOUR_ACCESS_KEY_ID
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
mfa_serial = YOUR_MFA_ARN

[account_two]
aws_access_key_id = YOUR_ACCESS_KEY_ID
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
mfa_serial = YOUR_MFA_ARN

[account_one-mfa]
aws_access_key_id = YOUR_TEMPORARY_ACCESS_KEY_ID
aws_secret_access_key = YOUR_TEMPORARY_SECRET_ACCESS_KEY
aws_session_token = YOUR_TEMPORARY_SESSION_TOKEN

[account_two-mfa]
aws_access_key_id = YOUR_TEMPORARY_ACCESS_KEY_ID
aws_secret_access_key = YOUR_TEMPORARY_SECRET_ACCESS_KEY
aws_session_token = YOUR_TEMPORARY_SESSION_TOKEN
```

_config_:
```ini
[default]
region = eu-west-1
cli_pager=

[profile profile-that-use-mfa-from-account_one]
role_arn = arn:aws:iam::111111111111:role/your_role
source_profile = account_one-mfa

[profile profile-that-use-mfa-from-account_two]
role_arn = arn:aws:iam::222222222222:role/your_role
source_profile = account_two-mfa
```
google-dns 0.0.3
Google DNS
License: MIT
Requires Python: >=3.6

<h1 align="center">
  <br>
  <a href=https://upload.wikimedia.org/wikipedia/commons/e/ee/NTT_company_logo.svg"><img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/NTT_company_logo.svg"></a>
  <br>
  NTT x Google DNS
  <br>
</h1>


<p align="center">
  <a href="#modules">Modules</a> •
  <a href="#code-design">Code Design</a> •
  <a href="#install">Install</a> •
  <a href="#docker">Docker</a> •
  <a href="#pythonenv">PythonEnv</a> •
  <a href="#how-to-use">How To Use</a> •
</p>

This Google DNS package consists of :
- A NTT router IP parser to update dynamic DNS on google domains .

## Modules

| Component | Description |
| ---- | --- |
| **google_dns** | Contains the implementation of GoogleDNS |


# Code structure
```python
from setuptools import setup

from google_dns import __version__

setup(
    name="google_dns",
    version=__version__,
    packages=[
        "google_dns",
    ],
    url="https://github.com/JeanMaximilienCadic/ntt_google_dns",
    license="MIT",
    author="Jean Maximilien Cadic",
    long_description="".join(open("README.md", "r").readlines()),
    long_description_content_type="text/markdown",
    python_requires=">=3.6",
    install_requires=[r.rsplit()[0] for r in open("requirements.txt")],
    author_email="git@cadic.jp",
    description="Google DNS",
    classifiers=[
        "Programming Language :: Python :: 3.6",
        "License :: OSI Approved :: MIT License",
    ],
)

```

## Install
To clone and run this application, you'll need [Git](https://git-scm.com) and [ https://docs.docker.com/docker-for-mac/install/]( https://docs.docker.com/docker-for-mac/install/) and Python installed on your computer. 

From your command line:

```bash
# Clone this repository and install the code
git clone https://github.com/JeanMaximilienCadic/ntt_google_dns

# Go into the repository
cd ntt_google_dns
```

## Config file
Create a config file at `/opt/google_dns/config.yml`

```yaml
project: google_dns
url: 'http://[YOUR ROUTER IP]/ntt/information/fifth/current'
authorization: "dXNlcjphZG1pbg=="
cookie: 'HGWSESSIONID=1hoa40gjlzl2g'

hostnames:
- hostname: "mywebsite.com"
  google_id: "ksfjIkmldslI"
  google_password: 'sdk11kjl1jd'

```

## Makefile
Exhaustive list of make commands:
```
build_docker
push_docker
pull_docker
docker_run
checkout
all
all_branch
```
## Docker
(\* recommended)

To build and run the docker image
```
make build_docker
make docker_run
```

## PythonEnv
(\* not recommended)
```
python setup.py install 
```

## How to
* Run the cron job
```shell
python -m google_dns
```