{ "info": { "author": "Sergey Motovilovets", "author_email": "motovilovets.sergey@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# ssm-diff\n\nAWS [SSM Parameter Store](https://aws.amazon.com/ec2/systems-manager/parameter-store) is a really convenient, AWS-native, KMS-enabled storage for parameters and secrets. \n\nUnfortunately, as of now, it doesn't seem to provide any human-friendly ways of batch-managing [hierarchies of parameters](http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-working.html#sysman-paramstore-su-organize).\n\nThe goal of the `ssm-diff` tool is to simplify that process by unwraping path-style\n(/Dev/DBServer/MySQL/db-string13 = value) parameters into a YAML structure:\n```\nDev:\n DBServer:\n MySQL:\n db-string13: value\n```\n\nThen, given that this local YAML representation of the SSM Parameter Store state was edited, `calculating and applying diffs` on the parameters. \n\n`ssm-diff` supports complex data types as values and can operate within single or multiple prefixes.\n\n## Installation\n```\npip install ssm-diff\n```\n\n## Geting Started\nThe tool relies on native AWS SDK, thus, on a way SDK [figures out](http://boto3.readthedocs.io/en/latest/guide/configuration.html) an effective AWS configuration. You might want to configure it explicitly, setting `AWS_DEFAULT_REGION`, or `AWS_PROFILE`, before doing and manipulations on parameters\n\nWhen `AWS_PROFILE` environment variable is set, local state file will have a name corresponding to the profile name.\n\nBefore we start editing the local representation of parameters state, we have to get it from SMM:\n```\n$ ssm-diff init\n```\n\nwill create a local `parameters.yml` (or `.yml` if `AWS_PROFILE` is in use) file that stores a YAML representation of the SSM Parameter Store state.\n\nOnce you accomplish editing this file, adding, modifying or deleting parameters, run:\n```\n$ ssm-diff plan\n```\n\nWhich will show you the diff between this local representation and an SSM Parameter Store.\n\nFinally\n```\n$ ssm-diff apply\n```\nwill actually apply local changes to the Parameter Store.\n\nOperations can also be limited to a particular prefix(es):\n\n```\n$ ssm-diff -p /dev -p /qa/ci {init,plan,apply}\n```\n\nNOTE: when remote state diverges for some reason, but you still want to preserve remote changes, there's a:\n\n```\n$ ssm-diff pull\n```\ncommand, doing just that.\n\n## Examples\nLet's assume we have the following parameters set in SSM Parameter Store:\n```\n/qa/ci/api/db_schema = foo_ci\n/qa/ci/api/db_user = bar_ci\n/qa/ci/api/db_password = baz_ci\n/qa/uat/api/db_schema = foo_uat\n/qa/uat/api/db_user = bar_uat\n/qa/uat/api/db_password = baz_uat\n\n```\n\n```\n$ ssm-diff init\n```\nwill create a `parameters.yml` file with the following content:\n\n```\nqa:\n ci:\n api:\n db_schema: foo_ci\n db_user: bar_ci\n db_password: !secure 'baz_ci'\n uat:\n api:\n db_schema: foo_uat\n db_user: bar_uat\n db_password: !secure 'baz_uat'\n```\n\nKMS-encrypted (SecureString) and String type values are distunguished by `!secure` YAML tag.\n\nLet's drop the `ci`-related stuff completely, and edit `uat` parameters a bit, ending up with the following `parameters.yml` file contents:\n```\nqa:\n uat:\n api:\n db_schema: foo_uat\n db_charset: utf8mb4 \n db_user: bar_changed\n db_password: !secure 'baz_changed'\n```\n\nRunning\n```\n$ ssm-diff plan\n```\nwill give the following output:\n\n```\n- /qa/ci/api/db_schema\n- /qa/ci/api/db_user\n- /qa/ci/api/db_password\n+ /qa/uat/api/db_charset = utf8mb4\n~ /qa/uat/api/db_user:\n < bar_uat\n ---\n > bar_changed\n~ /qa/uat/api/db_password:\n < baz_uat\n ---\n > baz_changed\n\n```\n\nFinally\n```\n$ ssm-diff apply\n```\nwill actually do all the necessary modifications of parameters in SSM Parameter Store itself, applying local changes\n\n## Known issues and limitations\n- There's currently no option to use different KMS keys for `SecureString` values encryption.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/runtheops/ssm-diff/archive/0.5.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/runtheops/ssm-diff", "keywords": "aws,ssm,parameter-store", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ssm-diff", "package_url": "https://pypi.org/project/ssm-diff/", "platform": "", "project_url": "https://pypi.org/project/ssm-diff/", "project_urls": { "Download": "https://github.com/runtheops/ssm-diff/archive/0.5.tar.gz", "Homepage": "https://github.com/runtheops/ssm-diff" }, "release_url": "https://pypi.org/project/ssm-diff/0.5/", "requires_dist": [ "termcolor", "boto3", "dpath", "PyYAML" ], "requires_python": "", "summary": "A tool to manage contents of AWS SSM Parameter Store", "version": "0.5" }, "last_serial": 4196101, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "ce0d097d39c7754425bc8264df04edca", "sha256": "c5dcb0ed4594795fd8c14190c4f25e58ce30614f87d61342f392a47e4761c4c6" }, "downloads": -1, "filename": "ssm_diff-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "ce0d097d39c7754425bc8264df04edca", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7591, "upload_time": "2017-10-05T08:12:22", "url": "https://files.pythonhosted.org/packages/3d/6e/4c32f3754c5c2f303ceeddbbb553e3fd822668f09f56d479eadf1033809e/ssm_diff-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "de136569b6ef41af9da1f1de54b042a0", "sha256": "f3aeef0011e683b6f830c393a51b5c8a6335821eef7c010b530fe55c306cd5f8" }, "downloads": -1, "filename": "ssm-diff-0.2.tar.gz", "has_sig": false, "md5_digest": "de136569b6ef41af9da1f1de54b042a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4973, "upload_time": "2017-10-05T08:12:24", "url": "https://files.pythonhosted.org/packages/10/88/4084b62dd9e6dbadd5e2d53fd6a4ab389b88cc7b6889a98e1c075c472be8/ssm-diff-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "b9c133afd7d9216499868e152a0f995e", "sha256": "b52c66d51dbe2a5d952878a6076dfcd2aa5942cf8f1ac513163e45b62d9088a3" }, "downloads": -1, "filename": "ssm_diff-0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "b9c133afd7d9216499868e152a0f995e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 8121, "upload_time": "2017-10-05T14:09:41", "url": "https://files.pythonhosted.org/packages/27/b7/0b341c4d9fbaccc4c3eb612c01c9af0e53bd3886a77e0ba3696f5647675d/ssm_diff-0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ed3b5f00dbc81eac440e6434926c68f", "sha256": "f9f98f51b63fb955a2f0faaf9e064d41ae031f7be238f56f794f33f467a93576" }, "downloads": -1, "filename": "ssm-diff-0.3.tar.gz", "has_sig": false, "md5_digest": "9ed3b5f00dbc81eac440e6434926c68f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5418, "upload_time": "2017-10-05T14:09:42", "url": "https://files.pythonhosted.org/packages/7b/b9/9ac27075b494f97a05ecae927a9b5f7d83d49a21ac78a646afd215691a81/ssm-diff-0.3.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "c4907d345cc8dd69537ac35489a3e517", "sha256": "138c370c43fc1b0d70b7d1fd6ab63ff8919433e775f69f18ffc7f3eda698e12e" }, "downloads": -1, "filename": "ssm_diff-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "c4907d345cc8dd69537ac35489a3e517", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6586, "upload_time": "2018-08-22T12:40:33", "url": "https://files.pythonhosted.org/packages/89/d8/dbecd1ee5d71a4e24c8365a74d61da82d65fa6b7f6c2885a550a64d7cc18/ssm_diff-0.5-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c4907d345cc8dd69537ac35489a3e517", "sha256": "138c370c43fc1b0d70b7d1fd6ab63ff8919433e775f69f18ffc7f3eda698e12e" }, "downloads": -1, "filename": "ssm_diff-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "c4907d345cc8dd69537ac35489a3e517", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6586, "upload_time": "2018-08-22T12:40:33", "url": "https://files.pythonhosted.org/packages/89/d8/dbecd1ee5d71a4e24c8365a74d61da82d65fa6b7f6c2885a550a64d7cc18/ssm_diff-0.5-py3-none-any.whl" } ] }