auth-aws-profile


Nameauth-aws-profile JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryUpdates the configured MFA credentials for AWS services.
upload_time2024-08-31 09:11:53
maintainerNone
docs_urlNone
authorkdico
requires_python<4.0,>=3.12
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # auth-aws-profile

Make authenticating your AWS credentials with MFA easier by using a script provided in this repository.
Developed using Python 3.12 and [Poetry](https://python-poetry.org/).
The authentication process uses the V3 SDK for Python.

## Requirements

* Python `^3.12`.
* An AWS credentials file, e.g. `~/.aws/credentials`, with one or more sections that contain the following keys.
    * `aws_access_key_id`
    * `aws_secret_access_key`
    * `aws_session_token`
* An AWS configuration file, e.g. `~/.aws/config`, with one or more `[profile *]` sections.
    * The `[profile *]` should reference a section from `~/.aws/credentials` using `source_profile = *` and must have the `role_arn` key as well.

## Example

Here's what the script expects your AWS configuration and credentials file to look like.

```
# ~/.aws/config

[default]
region = <my-aws-region>
output = yaml

[profile my-role]
role_arn = arn:aws:iam::<my-aws-account-number>:role/my-role
source_profile = mfa
```

```
# ~/.aws/credentials

[default]
aws_access_key_id = foo
aws_secret_access_key = bar

[mfa]
aws_access_key_id = foo
aws_secret_access_key = bar
aws_session_token = baz
```

The AWS CLI can still find `my-role` even if you move it to `~/.aws/credentials` as long as it's renamed to `[my-role]` instead of `[profile my-role]`.
However, this script requires `my-role` to be in `~/.aws/config` and must be passed to the script using the complete profile section name, e.g. `profile my-role`.

## Usage

Install the script from PyPi and verify the version.

```
pip install auth-aws-profile
auth-aws-profile --version
```

Here's a simple usage example based on the files mentioned in [Example](#example).

```
auth-aws-profile "profile my-role" "arn:aws:iam::<my-aws-account-number>:mfa/john.doe"
```

See the help documentation for details.

```
auth-aws-profile --help
```

## Development

### Installation

* At least Python 3.12 must be installed.
* [Poetry](https://python-poetry.org/) is installed. See [Installation](https://python-poetry.org/docs/#installation).
* Install the project with Poetry from the root using `poetry install`.

### Installation (Dev Containers)

* Docker must be installed.
* Install the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension for VS Code or similar.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "auth-aws-profile",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": null,
    "author": "kdico",
    "author_email": "8462911+kdico@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/b3/c8/84675f110f64651887c0634327076a3c2cc0e9ef1075b536d5c86d9ab4bc/auth-aws-profile-0.2.0.tar.gz",
    "platform": null,
    "description": "# auth-aws-profile\n\nMake authenticating your AWS credentials with MFA easier by using a script provided in this repository.\nDeveloped using Python 3.12 and [Poetry](https://python-poetry.org/).\nThe authentication process uses the V3 SDK for Python.\n\n## Requirements\n\n* Python `^3.12`.\n* An AWS credentials file, e.g. `~/.aws/credentials`, with one or more sections that contain the following keys.\n    * `aws_access_key_id`\n    * `aws_secret_access_key`\n    * `aws_session_token`\n* An AWS configuration file, e.g. `~/.aws/config`, with one or more `[profile *]` sections.\n    * The `[profile *]` should reference a section from `~/.aws/credentials` using `source_profile = *` and must have the `role_arn` key as well.\n\n## Example\n\nHere's what the script expects your AWS configuration and credentials file to look like.\n\n```\n# ~/.aws/config\n\n[default]\nregion = <my-aws-region>\noutput = yaml\n\n[profile my-role]\nrole_arn = arn:aws:iam::<my-aws-account-number>:role/my-role\nsource_profile = mfa\n```\n\n```\n# ~/.aws/credentials\n\n[default]\naws_access_key_id = foo\naws_secret_access_key = bar\n\n[mfa]\naws_access_key_id = foo\naws_secret_access_key = bar\naws_session_token = baz\n```\n\nThe AWS CLI can still find `my-role` even if you move it to `~/.aws/credentials` as long as it's renamed to `[my-role]` instead of `[profile my-role]`.\nHowever, this script requires `my-role` to be in `~/.aws/config` and must be passed to the script using the complete profile section name, e.g. `profile my-role`.\n\n## Usage\n\nInstall the script from PyPi and verify the version.\n\n```\npip install auth-aws-profile\nauth-aws-profile --version\n```\n\nHere's a simple usage example based on the files mentioned in [Example](#example).\n\n```\nauth-aws-profile \"profile my-role\" \"arn:aws:iam::<my-aws-account-number>:mfa/john.doe\"\n```\n\nSee the help documentation for details.\n\n```\nauth-aws-profile --help\n```\n\n## Development\n\n### Installation\n\n* At least Python 3.12 must be installed.\n* [Poetry](https://python-poetry.org/) is installed. See [Installation](https://python-poetry.org/docs/#installation).\n* Install the project with Poetry from the root using `poetry install`.\n\n### Installation (Dev Containers)\n\n* Docker must be installed.\n* Install the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension for VS Code or similar.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Updates the configured MFA credentials for AWS services.",
    "version": "0.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/kdico/auth-aws-profile/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6d775be7440c29c846ff838e87d0ab0a6cab6b6d07771050c5fcfeec46820b17",
                "md5": "6b1e9e36d68d71d19090d1ad6d71b7b5",
                "sha256": "1784d00b4e447c0145fbd7e9945f40d8afa7d022eae1ecbd6d421ba2aa3a8383"
            },
            "downloads": -1,
            "filename": "auth_aws_profile-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6b1e9e36d68d71d19090d1ad6d71b7b5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 6107,
            "upload_time": "2024-08-31T09:11:54",
            "upload_time_iso_8601": "2024-08-31T09:11:54.814019Z",
            "url": "https://files.pythonhosted.org/packages/6d/77/5be7440c29c846ff838e87d0ab0a6cab6b6d07771050c5fcfeec46820b17/auth_aws_profile-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3c884675f110f64651887c0634327076a3c2cc0e9ef1075b536d5c86d9ab4bc",
                "md5": "3a22bb485eb5b0911611b7f03e19b243",
                "sha256": "c73d7fbaf25d1f69a5ad7956cc16df489a4783e0154ced05dde3b7bb6fa73328"
            },
            "downloads": -1,
            "filename": "auth-aws-profile-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3a22bb485eb5b0911611b7f03e19b243",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 5742,
            "upload_time": "2024-08-31T09:11:53",
            "upload_time_iso_8601": "2024-08-31T09:11:53.848577Z",
            "url": "https://files.pythonhosted.org/packages/b3/c8/84675f110f64651887c0634327076a3c2cc0e9ef1075b536d5c86d9ab4bc/auth-aws-profile-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-31 09:11:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kdico",
    "github_project": "auth-aws-profile",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "auth-aws-profile"
}
        
Elapsed time: 0.65823s