{ "info": { "author": "Garth Kidd", "author_email": "garth@garthk.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: Python", "Topic :: System :: Systems Administration", "Topic :: Utilities" ], "description": "===============\nwith-aws-config\n===============\n\nSet AWS `environment variables`_ from the configuration files maintained by\n`aws configure`_, then run a command.\n\n.. _aws configure: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html\n\n------------\nInstallation\n------------\n\n* ``pip install with_aws_config``\n* ``pip show with-aws-config -f``\n* Ensure ``with-aws-config`` is on your ``PATH``\n\n-----\nUsage\n-----\n\n``with-aws-config [-h] [--verbose] [--profile PROFILE] COMMAND [ARGUMENT ...]``\n\n~~~~~~~~~~~~~~~~~~~~\nPositional arguments\n~~~~~~~~~~~~~~~~~~~~\n\n``COMMAND``\n the command to run, e.g. ``ec2-describe-instances``, ``aws``, or ``ansible``\n``ARGUMENT``\n the command's arguments, e.g. ``iam get-user``\n\nIf any arguments are options, specify ``--`` before the command to end\n``with-aws-config``'s optional argument parsing.\n\n~~~~~~~~~~~~~~~~~~\nOptional arguments\n~~~~~~~~~~~~~~~~~~\n\n``-h, --help``\n show this help message and exit\n``--verbose``, ``-v``\n output debugging information to stderr\n``--profile PROFILE``, ``-p PROFILE``\n set the profile, ignoring any `environment variables`_\n\n---------\nBehaviour\n---------\n\n``with-aws-config``:\n\n* Loads profile information stored by ``aws configure``\n* Runs the `command and arguments`_ with `adjusted environment variables`_, and\n* Exits with its `exit status`_ if possible.\n\nYou have three ways to specify the profile:\n\n* Default to ``default``\n* Give the ``--profile`` or ``-p`` `optional arguments`_\n* Set the ``AWS_PROFILE`` or ``AWS_DEFAULT_PROFILE`` `input environment variables`_\n\n.. _option: `optional arguments`_\n.. _adjusted environment variables: output_\n.. _input environment variables: input_\n.. _command and arguments: `positional arguments`_\n.. _aws cli: https://aws.amazon.com/documentation/cli/\n.. _ec2 cli: https://aws.amazon.com/developertools/351\n.. _ansible: http://www.ansible.com/home\n.. _boto: http://docs.pythonboto.org/en/latest/\n\n--------\nExamples\n--------\n\nRun a command:\n\n ::\n\n with-aws-config -- aws iam get-user\n with-aws-config -- ec2-list-instances\n with-aws-config -- ansible-playbook setup-vpc.yaml\n\nSpecify a profile as an option:\n\n ::\n\n with-aws-config --profile=default -- ec2-describe-instances\n\nSpecify a profile via the environment:\n\n ::\n\n env AWS_DEFAULT_PROFILE=default with-aws-config -- ec2-describe-instances\n\nNote we've used ``--`` in each to force the end of the `optional arguments`_.\n\n---------------------\nEnvironment Variables\n---------------------\n\n~~~~~\nInput\n~~~~~\n\n* ``AWS_PROFILE`` is used to specify profile if ``--profile`` is not given\n* ``AWS_DEFAULT_PROFILE`` is used if ``AWS_PROFILE`` is not set\n* ``HOME`` is required to locate ``$HOME/.aws``\n\n~~~~~~\nOutput\n~~~~~~\n\n``COMMAND`` will be run with the environment supplied to ``with-aws-config``,\nwith the following exceptions:\n\nThe following environment variables will be removed:\n\n* ``AWS_CONFIG_FILE``\n* ``AWS_DEFAULT_PROFILE``\n* ``AWS_PROFILE``\n* ``AWS_SESSION_TOKEN``\n\nThe following environment variables will be set based on the AWS profile:\n\n* ``AWS_ACCESS_KEY``\n* ``AWS_ACCESS_KEY_ID``\n* ``AWS_DEFAULT_REGION``\n* ``AWS_SECRET_ACCESS_KEY``\n* ``AWS_SECRET_KEY``\n* ``EC2_URL``\n\n``AWS_DEFAULT_REGION`` and ``EC2_URL`` will default to point to ``us-west-2``\nif not configured during ``aws configure``.\n\nWhy this many?\n\n* ``aws``, ``boto``, and ``ansible`` need ``AWS_ACCESS_KEY_ID``,\n ``AWS_SECRET_ACCESS_KEY``, and ``AWS_DEFAULT_REGION``\n\n* ``ec2-*`` need ``AWS_ACCESS_KEY``, ``AWS_SECRET_KEY``, and ``EC2_URL``\n\n-----------\nExit Status\n-----------\n\n``with-aws-config`` exits with either:\n\n* The exit status of ``COMMAND`` or, if it can't be run:\n* One of the following status codes indicating why:\n\n :``124``: no configuration files found\n :``125``: no configuration section found for the requested profile\n :``127``: command not found\n :``130``: interrupted by user with ^C", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/garthk/with_aws_config", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "with_aws_config", "package_url": "https://pypi.org/project/with_aws_config/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/with_aws_config/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/garthk/with_aws_config" }, "release_url": "https://pypi.org/project/with_aws_config/1.0.4/", "requires_dist": null, "requires_python": null, "summary": "Set AWS envars from `aws configure`, then run a command.", "version": "1.0.4" }, "last_serial": 1787897, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "b8a55fbd584b586bbcfebb021a473d4e", "sha256": "756c7d9d2961f1190821537f893306dab37a8d80000a12b9cb94cd1d2ff005f9" }, "downloads": -1, "filename": "with_aws_config-1.0.1.tar.gz", "has_sig": false, "md5_digest": "b8a55fbd584b586bbcfebb021a473d4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4675, "upload_time": "2015-08-21T00:33:37", "url": "https://files.pythonhosted.org/packages/bd/4f/97f34ddd46bd04fa5be67d7f2c258610ff181fd54f9d7bc4b1272186ecec/with_aws_config-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "dfcf560ba5d7779ecf0c1b8efa17de2a", "sha256": "16a6651d5a250b6b3a9ab8a586b6923f3a5d7e3a4beff12d573c1bd55ce51559" }, "downloads": -1, "filename": "with_aws_config-1.0.2.tar.gz", "has_sig": false, "md5_digest": "dfcf560ba5d7779ecf0c1b8efa17de2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4887, "upload_time": "2015-08-21T00:48:27", "url": "https://files.pythonhosted.org/packages/1e/27/0cdaf3cba6d412d316a0e7958835d0aa2450275eff5e5b7495d153e61583/with_aws_config-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "a252dab3757c0dd1a71fbfb1fa18fae5", "sha256": "260ecba259fda893bac85a2f4ca3b4a2747c517f68cd055fad8e862994ff3083" }, "downloads": -1, "filename": "with_aws_config-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a252dab3757c0dd1a71fbfb1fa18fae5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5045, "upload_time": "2015-08-21T01:08:21", "url": "https://files.pythonhosted.org/packages/64/09/ca7af35673e9c4a91c30941e1dcb439915f9f328b91a8bec329122bdfd4d/with_aws_config-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "fb3581eecfd2c612c10478492f6276da", "sha256": "7920699f3f84a4d7d53f2fbb03e0e249faeefd687703c3290ba45a18a62c678b" }, "downloads": -1, "filename": "with_aws_config-1.0.4.tar.gz", "has_sig": false, "md5_digest": "fb3581eecfd2c612c10478492f6276da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5085, "upload_time": "2015-10-27T05:37:18", "url": "https://files.pythonhosted.org/packages/93/6f/6eb38184d953919cd79820572a391369a719a4c4271414417fdd21dc6742/with_aws_config-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fb3581eecfd2c612c10478492f6276da", "sha256": "7920699f3f84a4d7d53f2fbb03e0e249faeefd687703c3290ba45a18a62c678b" }, "downloads": -1, "filename": "with_aws_config-1.0.4.tar.gz", "has_sig": false, "md5_digest": "fb3581eecfd2c612c10478492f6276da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5085, "upload_time": "2015-10-27T05:37:18", "url": "https://files.pythonhosted.org/packages/93/6f/6eb38184d953919cd79820572a391369a719a4c4271414417fdd21dc6742/with_aws_config-1.0.4.tar.gz" } ] }