mpaws


Namempaws JSON
Version 0.11.0 PyPI version JSON
download
home_pagehttps://github.com/cliffano/mpaws
SummaryExecute AWS CLI across multiple profiles and multiple regions in one go
upload_time2023-10-23 12:05:34
maintainer
docs_urlNone
authorCliffano Subagio
requires_python>=3.8,<4.0
licenseApache-2.0
keywords mpaws aws cli multi multiple profiles regions
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            <img align="right" src="https://raw.github.com/cliffano/mpaws/main/avatar.jpg" alt="Avatar"/>

[![Build Status](https://github.com/cliffano/mpaws/workflows/CI/badge.svg)](https://github.com/cliffano/mpaws/actions?query=workflow%3ACI)
[![Security Status](https://snyk.io/test/github/cliffano/mpaws/badge.svg)](https://snyk.io/test/github/cliffano/mpaws)
[![Published Version](https://img.shields.io/pypi/v/mpaws.svg)](https://pypi.python.org/pypi/mpaws)
<br/>

mpaws
-----

mpaws is a Python CLI for running an AWS command across multiple profiles and multiple regions in one go.

This is a time-saver when you are managing dozens of AWS accounts and need to run the same command across all of them.

Installation
------------

    pip3 install mpaws

Usage
-----

Set an environment variable `MPAWS_PROFILES`, and another environment variable `MPAWS_REGIONS`, then run `mpaws` command:
 
    export MPAWS_PROFILES=profile1,profile2,profile3
    export MPAWS_REGIONS=us-east-1,ap-southeast-2
    mpaws ec2 describe-instances

The above command will run `aws ec2 describe-instances` command for each permutation of the AWS profiles and AWS regions, like these:
  
    AWS_PROFILE=profile1 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances
    AWS_PROFILE=profile1 AWS_DEFAULT_REGION=ap-southeast-2 AWS_REGION=ap-southeast-2 aws ec2 describe-instances
    AWS_PROFILE=profile2 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances
    AWS_PROFILE=profile2 AWS_DEFAULT_REGION=ap-southeast-2 AWS_REGION=ap-southeast-2 aws ec2 describe-instances
    AWS_PROFILE=profile3 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances
    AWS_PROFILE=profile3 AWS_DEFAULT_REGION=ap-southeast-2 AWS_REGION=ap-southeast-2 aws ec2 describe-instances

Alternatively, you can also run `mpaws` with multiple AWS profiles against a single AWS region. You can do this by setting the environment variable `MPAWS_PROFILES`, then run `mpaws` command:
 
    export MPAWS_PROFILES=profile1,profile2,profile3
    mpaws ec2 describe-instances

The above command will run `aws ec2 describe-instances` command using each AWS profile, combined with the configured AWS region (either via `AWS_DEFAULT_REGION`, `AWS_REGION`, or [the configured region within the profile definition](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-configure-files-format-profile)).

Here's an example if `AWS_DEFAULT_REGION` is specified with us-east-1 as the value:

    AWS_PROFILE=profile1 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances
    AWS_PROFILE=profile2 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances-instances
    AWS_PROFILE=profile3 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances

Note that each run will also carry over the environment variables available from the original `mpaws` command run.

Configuration
-------------

Ensure that the profiles specified in `MPAWS_PROFILES` are already [configured in credential file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). And the regions specified in `MPAWS_REGIONS`, `AWS_DEFAULT_REGION`, `AWS_REGION`, or AWS configuration are [valid regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/).

| Environment Variable | Mandatory | Example |
|----------------------|-----------|---------|
| MPAWS_PROFILES | Yes | profile1,profile2,profile3 |
| MPAWS_REGIONS | No | us-east-1,ap-southeast-2 |
| AWS_DEFAULT_REGION | No | us-east-1 |
| AWS_REGION | No | us-east-1 |

Colophon
--------

[Developer's Guide](https://cliffano.github.io/developers_guide.html#python)

Build reports:

* [Lint report](https://cliffano.github.io/mpaws/lint/pylint/index.html)
* [Code complexity report](https://cliffano.github.io/mpaws/complexity/wily/index.html)
* [Unit tests report](https://cliffano.github.io/mpaws/test/pytest/index.html)
* [Test coverage report](https://cliffano.github.io/mpaws/coverage/coverage/index.html)
* [Integration tests report](https://cliffano.github.io/mpaws/test-integration/pytest/index.html)
* [API Documentation](https://cliffano.github.io/mpaws/doc/sphinx/index.html)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cliffano/mpaws",
    "name": "mpaws",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "mpaws,aws,cli,multi,multiple,profiles,regions",
    "author": "Cliffano Subagio",
    "author_email": "cliffano@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bc/6c/80b4f67b3fd2cdd20fd9829e666440415537af73099e343cb83512776740/mpaws-0.11.0.tar.gz",
    "platform": null,
    "description": "<img align=\"right\" src=\"https://raw.github.com/cliffano/mpaws/main/avatar.jpg\" alt=\"Avatar\"/>\n\n[![Build Status](https://github.com/cliffano/mpaws/workflows/CI/badge.svg)](https://github.com/cliffano/mpaws/actions?query=workflow%3ACI)\n[![Security Status](https://snyk.io/test/github/cliffano/mpaws/badge.svg)](https://snyk.io/test/github/cliffano/mpaws)\n[![Published Version](https://img.shields.io/pypi/v/mpaws.svg)](https://pypi.python.org/pypi/mpaws)\n<br/>\n\nmpaws\n-----\n\nmpaws is a Python CLI for running an AWS command across multiple profiles and multiple regions in one go.\n\nThis is a time-saver when you are managing dozens of AWS accounts and need to run the same command across all of them.\n\nInstallation\n------------\n\n    pip3 install mpaws\n\nUsage\n-----\n\nSet an environment variable `MPAWS_PROFILES`, and another environment variable `MPAWS_REGIONS`, then run `mpaws` command:\n \n    export MPAWS_PROFILES=profile1,profile2,profile3\n    export MPAWS_REGIONS=us-east-1,ap-southeast-2\n    mpaws ec2 describe-instances\n\nThe above command will run `aws ec2 describe-instances` command for each permutation of the AWS profiles and AWS regions, like these:\n  \n    AWS_PROFILE=profile1 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances\n    AWS_PROFILE=profile1 AWS_DEFAULT_REGION=ap-southeast-2 AWS_REGION=ap-southeast-2 aws ec2 describe-instances\n    AWS_PROFILE=profile2 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances\n    AWS_PROFILE=profile2 AWS_DEFAULT_REGION=ap-southeast-2 AWS_REGION=ap-southeast-2 aws ec2 describe-instances\n    AWS_PROFILE=profile3 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances\n    AWS_PROFILE=profile3 AWS_DEFAULT_REGION=ap-southeast-2 AWS_REGION=ap-southeast-2 aws ec2 describe-instances\n\nAlternatively, you can also run `mpaws` with multiple AWS profiles against a single AWS region. You can do this by setting the environment variable `MPAWS_PROFILES`, then run `mpaws` command:\n \n    export MPAWS_PROFILES=profile1,profile2,profile3\n    mpaws ec2 describe-instances\n\nThe above command will run `aws ec2 describe-instances` command using each AWS profile, combined with the configured AWS region (either via `AWS_DEFAULT_REGION`, `AWS_REGION`, or [the configured region within the profile definition](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-configure-files-format-profile)).\n\nHere's an example if `AWS_DEFAULT_REGION` is specified with us-east-1 as the value:\n\n    AWS_PROFILE=profile1 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances\n    AWS_PROFILE=profile2 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances-instances\n    AWS_PROFILE=profile3 AWS_DEFAULT_REGION=us-east-1 AWS_REGION=us-east-1 aws ec2 describe-instances\n\nNote that each run will also carry over the environment variables available from the original `mpaws` command run.\n\nConfiguration\n-------------\n\nEnsure that the profiles specified in `MPAWS_PROFILES` are already [configured in credential file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). And the regions specified in `MPAWS_REGIONS`, `AWS_DEFAULT_REGION`, `AWS_REGION`, or AWS configuration are [valid regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/).\n\n| Environment Variable | Mandatory | Example |\n|----------------------|-----------|---------|\n| MPAWS_PROFILES | Yes | profile1,profile2,profile3 |\n| MPAWS_REGIONS | No | us-east-1,ap-southeast-2 |\n| AWS_DEFAULT_REGION | No | us-east-1 |\n| AWS_REGION | No | us-east-1 |\n\nColophon\n--------\n\n[Developer's Guide](https://cliffano.github.io/developers_guide.html#python)\n\nBuild reports:\n\n* [Lint report](https://cliffano.github.io/mpaws/lint/pylint/index.html)\n* [Code complexity report](https://cliffano.github.io/mpaws/complexity/wily/index.html)\n* [Unit tests report](https://cliffano.github.io/mpaws/test/pytest/index.html)\n* [Test coverage report](https://cliffano.github.io/mpaws/coverage/coverage/index.html)\n* [Integration tests report](https://cliffano.github.io/mpaws/test-integration/pytest/index.html)\n* [API Documentation](https://cliffano.github.io/mpaws/doc/sphinx/index.html)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Execute AWS CLI across multiple profiles and multiple regions in one go",
    "version": "0.11.0",
    "project_urls": {
        "Documentation": "https://github.com/cliffano/mpaws",
        "Homepage": "https://github.com/cliffano/mpaws",
        "Repository": "https://github.com/cliffano/mpaws"
    },
    "split_keywords": [
        "mpaws",
        "aws",
        "cli",
        "multi",
        "multiple",
        "profiles",
        "regions"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "330860672b6eae0861fcf18ccc5d8d68c68b405a051bef23e1ecfb962ff8f8d9",
                "md5": "aa0df6b4f45f724bf42db0600f66028f",
                "sha256": "42a48c55fc44d9ba06c4a46e3ff901b52255ed8bcee69b309fb3201b4e3eea80"
            },
            "downloads": -1,
            "filename": "mpaws-0.11.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aa0df6b4f45f724bf42db0600f66028f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 8518,
            "upload_time": "2023-10-23T12:05:32",
            "upload_time_iso_8601": "2023-10-23T12:05:32.925008Z",
            "url": "https://files.pythonhosted.org/packages/33/08/60672b6eae0861fcf18ccc5d8d68c68b405a051bef23e1ecfb962ff8f8d9/mpaws-0.11.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc6c80b4f67b3fd2cdd20fd9829e666440415537af73099e343cb83512776740",
                "md5": "50b0b2a11ba04823bf884d3a382da985",
                "sha256": "edce3f5d39724090d4437fdaf5ea1317ca2804c5b2f84193bfce45a18482fa21"
            },
            "downloads": -1,
            "filename": "mpaws-0.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "50b0b2a11ba04823bf884d3a382da985",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 7646,
            "upload_time": "2023-10-23T12:05:34",
            "upload_time_iso_8601": "2023-10-23T12:05:34.404762Z",
            "url": "https://files.pythonhosted.org/packages/bc/6c/80b4f67b3fd2cdd20fd9829e666440415537af73099e343cb83512776740/mpaws-0.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-23 12:05:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cliffano",
    "github_project": "mpaws",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "mpaws"
}
        
Elapsed time: 0.16035s