{ "info": { "author": "Doug Kerwin", "author_email": "dwkerwin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "ssm-starter\n===========\n\n|PyPI version|\n\nLoads AWS SSM Parameter Store parameters into local system environment\nvariables and then executes your application so it has access to those\nenvironment variables.\n\nThis was inspired by the Twelve-Factor App principle `Store config in\nthe environment `__.\n\nThe intended use case is to be used as the ENTRYPOINT to Docker\ncontainers which run in AWS where the application gets its configuration\nfrom SSM and stores it in the environment, then starts the application,\nwhich can reference these values through the environment.\n\nInstallation\n------------\n\n.. code:: shell\n\n pip install ssm-starter\n\nUsage\n-----\n\nSSM-Starter is installed as a command line utility and can be run as:\n\n.. code:: shell\n\n ssm-starter --ssm-name /dev/my-app/ --command /bin/bash run-app.sh\n\nRegarding format of ssm-name and pathing, note that all of the following\nare equivalent:\n\n.. code:: shell\n\n ssm-starter --ssm-name /dev/my-app --command /bin/bash run-app.sh\n ssm-starter --ssm-name /dev/my-app/ --command /bin/bash run-app.sh\n AWS_ENV=dev ssm-starter --ssm-name my-app --command /bin/bash run-app.sh\n\nExample\n-------\n\nLet's say you have the following three AWS SSM Parameters and their\nvalues.\n\n+------------+----------+\n| SSM Path | Value |\n+============+==========+\n| /dev/my-ap | abc123 |\n| p/MYAPP\\_T | |\n| EST\\_VAR | |\n+------------+----------+\n| /dev/my-ap | Server=m |\n| p/MYAPP\\_D | yserver; |\n| B\\_CONN\\_S | Database |\n| TRING | =mydb;Ui |\n| | d=myuid; |\n| | Pwd=secr |\n| | et; |\n+------------+----------+\n| /dev/my-ap | xyz789 |\n| p/MYAPP\\_T | |\n| EST\\_TWO | |\n+------------+----------+\n\nRunning ssm-starter with the ssm-name \"my-app\" and environment variable\nAWS\\_ENV set to \"dev\" result in the following:\n\n.. code:: shell\n\n $ export AWS_REGION=us-east-1\n $ export AWS_ENV=dev\n $ ssm-starter --ssm-name my-app --command /bin/bash run-app.sh\n Reading parameters from SSM path: /dev/my-app/\n Read 3 parameters from SSM\n MYAPP_TEST_VAR - setting value from ssm: abc123\n MYAPP_DB_CONN_STRING - setting value from ssm (SecureString, 51 chars)\n MYAPP_TEST_TWO already in environment\n /bin/bash run-app.sh\n\nAfter this runs these variables are in the environment and accessible to\nthe application. Notice that if the SSM parameter was stored as a\nSecureString, the value is not echoed to stdout, and that if an\nenvironment variable already exists with that name, it is not\noverwritten. So if an environment variable is directly passed into the\ncontainer through \"docker run -e\" or given to it by an orchestrator such\nas if it is defined in the task definition for ECS, that will take\nprecidence.\n\nArguments\n---------\n\n``--ssm-name`` The name prefix of your application. If you have an\nenvironment variable AWS\\_ENV present, it will additionally prefix this\nwith that. Multiple ``--ssm-name`` arguments can be provided in which\ncase SSM starter will read all parameters from each SSM path provided.\n\n``--command`` The command to execute after loading the SSM variables\ninto the environment. The command does not need to be enclosed in quotes\nbut *this should be the last argument as all arguments after this are\nassumed to be part of the command to execute*.\n\n``--abort-if-duplicates`` This optional argument will instruct SSM\nStarter to abort (non-zero exit code) if any duplicate parameter names\nare found. This would only occur if multiple ``--ssm-name`` arguments\nare provided. The default behavior is to skip any encountered\nduplicates, which also logs a warning message.\n\n``--overwrite-if-duplicates`` This optional argument will instruct SSM\nStarter to overwrite if any duplicate parameter names are found, so the\nlast parameter \"wins\". This would only occur if multiple ``--ssm-name``\narguments are provided. The default behavior is to skip any encountered\nduplicates, which also logs a warning message.\n\n``AWS_ENV`` (environment variable) If present, this will be prefixed\nbefore the supplied ssm-name. If you have a separate AWS accounts for\neach environment, you will not need this. If however you are sharing a\nsingle AWS account for multiple environments (dev, stage, prod, etc)\nthen this provides a way to partition the SSM variables.\n\n``AWS_REGION`` (environment variable) The AWS\\_REGION environment\nvariable is expected to be present. Region is set by this environment\nvariable rather than though an argument to ssm-starter so that the same\nconfiguration can be promoted to multiple environments that may be in\ndifferent regions. If only AWS\\_REGION is set, ssm-starter will also set\nAWS\\_DEFAULT\\_REGION to the same value. If both are set and in conflict,\nssm-starter will set both to the value in AWS\\_REGION.\n\nBuild and test locally\n----------------------\n\n.. code:: shell\n\n docker build -t billtrust/ssm-starter:build -f Dockerfile.buildenv .\n\n pip install iam-docker-run --user\n\n # specify a valid IAM role name which has full permissions to SSM\n export IAM_ROLE_NAME=\"role-ops-developers\"\n\n # specify a local AWS profile name which has access to assume the above IAM role\n export AWS_PROFILE_NAME=\"dev\"\n\n # this executes the integration test using python scripttest in the context of\n # the specified IAM role which has access to SSM\n iam-docker-run \\\n --image billtrust/ssm-starter:build \\\n --aws-role-name $IAM_ROLE_NAME \\\n --profile $AWS_PROFILE_NAME \\\n --host-source-path . \\\n --full-entrypoint \"make test\"\n\nPublishing Updates to PyPi\n--------------------------\n\nFor the maintainer - to publish an updated version of ssm-search,\nincrement the version number in version.py and run the following:\n\n.. code:: shell\n\n docker build -f ./Dockerfile.buildenv -t billtrust/ssm-starter:build .\n docker run --rm -it --entrypoint make billtrust/ssm-starter:build publish\n\nAt the prompts, enter the username and password to the Billtrust\npypi.org repo.\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2018 Factor Systems Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n.. |PyPI version| image:: https://badge.fury.io/py/ssm-starter.svg\n :target: https://badge.fury.io/py/ssm-starter", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/billtrust/ssm-starter", "keywords": "aws,ssm,aws-ssm,parameter-store", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ssm-starter", "package_url": "https://pypi.org/project/ssm-starter/", "platform": "", "project_url": "https://pypi.org/project/ssm-starter/", "project_urls": { "Homepage": "https://github.com/billtrust/ssm-starter" }, "release_url": "https://pypi.org/project/ssm-starter/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "Read AWS SSM parameters into the environment, then start your app.", "version": "0.2.2" }, "last_serial": 4382507, "releases": { "0.1.12": [ { "comment_text": "", "digests": { "md5": "a03668a84a9783d3be4d346954c31e56", "sha256": "70a68424f60ae4fd6f82641e1cfaf3c56850cff4ceb2c983a0c8e62b05ba2e00" }, "downloads": -1, "filename": "ssm-starter-0.1.12.tar.gz", "has_sig": false, "md5_digest": "a03668a84a9783d3be4d346954c31e56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4484, "upload_time": "2018-05-15T18:19:35", "url": "https://files.pythonhosted.org/packages/52/dd/8b9a0144da99a6e71b286efe2f9b1124440fdadcb7e53a14904319f1b90b/ssm-starter-0.1.12.tar.gz" } ], "0.1.13": [ { "comment_text": "", "digests": { "md5": "4d8ad07c5d933f53b74088df9c64cd1e", "sha256": "c0a73bab2c4c595169e011be8218db7ffbaa760563f6702504e3d25f63aabee3" }, "downloads": -1, "filename": "ssm-starter-0.1.13.tar.gz", "has_sig": false, "md5_digest": "4d8ad07c5d933f53b74088df9c64cd1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4780, "upload_time": "2018-05-15T18:27:11", "url": "https://files.pythonhosted.org/packages/da/cc/84880f04111c4002e9e90a045f500a22576f7f2067430872038b5a24a521/ssm-starter-0.1.13.tar.gz" } ], "0.1.14": [ { "comment_text": "", "digests": { "md5": "ff2d7bbe1508c3f1df9f2b396bcad511", "sha256": "2794f96f0de59f61aa61a44612a62fc8f52fe1a2e72b1b21d62814169f178746" }, "downloads": -1, "filename": "ssm-starter-0.1.14.tar.gz", "has_sig": false, "md5_digest": "ff2d7bbe1508c3f1df9f2b396bcad511", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4915, "upload_time": "2018-05-15T18:35:48", "url": "https://files.pythonhosted.org/packages/47/12/12d84cc8e9bca320419f3c6e1adfda6ef6fefe2baeeb27fea45c58ce7d95/ssm-starter-0.1.14.tar.gz" } ], "0.1.15": [ { "comment_text": "", "digests": { "md5": "794a2d99132bb1ae9378749cc90b1c3a", "sha256": "69175e04e01d2420c8858a9890686f0ceb7ef93ee39c63fd58a8f26747ba6bbd" }, "downloads": -1, "filename": "ssm-starter-0.1.15.tar.gz", "has_sig": false, "md5_digest": "794a2d99132bb1ae9378749cc90b1c3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5037, "upload_time": "2018-06-19T16:51:29", "url": "https://files.pythonhosted.org/packages/39/03/0c0fb2b158dd2f4fbbda11d0c95e3586cce83861aeaf744b8c904bc9b3a1/ssm-starter-0.1.15.tar.gz" } ], "0.1.16": [ { "comment_text": "", "digests": { "md5": "4050e8286a4e8d7c85ed281e2592e7a1", "sha256": "b033872c842e96589b34e9446562894342f965a9f7dbe8d89494d518e853e3d9" }, "downloads": -1, "filename": "ssm-starter-0.1.16.tar.gz", "has_sig": false, "md5_digest": "4050e8286a4e8d7c85ed281e2592e7a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5082, "upload_time": "2018-06-19T20:00:37", "url": "https://files.pythonhosted.org/packages/49/b5/f228d3a66fc0d404bf274810cfa881e10144b2ecf7313b013e8d7625db7e/ssm-starter-0.1.16.tar.gz" } ], "0.1.17": [ { "comment_text": "", "digests": { "md5": "60cd647152d7e9254c5e1107cb7c3c23", "sha256": "48f86f02b516d1912f8512c152d16761d6a816c6a7636a31d4bfac9aa6325247" }, "downloads": -1, "filename": "ssm-starter-0.1.17.tar.gz", "has_sig": false, "md5_digest": "60cd647152d7e9254c5e1107cb7c3c23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5174, "upload_time": "2018-06-20T19:03:28", "url": "https://files.pythonhosted.org/packages/cb/41/8cca9ddc76e08bc4fd029067364cc7f02ad226f911f980adc5524d82c911/ssm-starter-0.1.17.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "e169b8e5c4f3f673c6978090b7df3224", "sha256": "5b23c251ad17d70b142c42f343e3ae6c5160e81d894aef7e827b2b14dda45a1c" }, "downloads": -1, "filename": "ssm-starter-0.2.0.tar.gz", "has_sig": false, "md5_digest": "e169b8e5c4f3f673c6978090b7df3224", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8360, "upload_time": "2018-10-05T19:42:02", "url": "https://files.pythonhosted.org/packages/6f/32/53c7d93c069c9a0870e75e6fad17a988c3388e258e3b9c004aac8289ee53/ssm-starter-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "777823f5a624d2990def5b0e871c82d8", "sha256": "9392bbc55f5b4def2d5ff1e36e901972c76c49981a70d64c4cdb6fc486b29de1" }, "downloads": -1, "filename": "ssm-starter-0.2.1.tar.gz", "has_sig": false, "md5_digest": "777823f5a624d2990def5b0e871c82d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8413, "upload_time": "2018-10-05T19:53:14", "url": "https://files.pythonhosted.org/packages/62/72/d112f7417f4dfe6c4f62684d27b95d4f58365ca9022efae4cd7b67259d2f/ssm-starter-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "9defe42a7018e188bd9d1e292c383e8c", "sha256": "e06cedad598099c70dc21dfddfe9e9989a8f56488f0395de61b46aed8c8d07cc" }, "downloads": -1, "filename": "ssm-starter-0.2.2.tar.gz", "has_sig": false, "md5_digest": "9defe42a7018e188bd9d1e292c383e8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8426, "upload_time": "2018-10-16T17:25:09", "url": "https://files.pythonhosted.org/packages/a6/14/a8442fb2e2d50eee580a85f0fb5937a944bf0308470dcfd39a029078c118/ssm-starter-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9defe42a7018e188bd9d1e292c383e8c", "sha256": "e06cedad598099c70dc21dfddfe9e9989a8f56488f0395de61b46aed8c8d07cc" }, "downloads": -1, "filename": "ssm-starter-0.2.2.tar.gz", "has_sig": false, "md5_digest": "9defe42a7018e188bd9d1e292c383e8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8426, "upload_time": "2018-10-16T17:25:09", "url": "https://files.pythonhosted.org/packages/a6/14/a8442fb2e2d50eee580a85f0fb5937a944bf0308470dcfd39a029078c118/ssm-starter-0.2.2.tar.gz" } ] }