{ "info": { "author": "Michael Palmer", "author_email": "github@michaeldpalmer.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Topic :: Utilities" ], "description": "# Gossamer/AWS Alias Generator\n\nGenerates [Gossamer](https://github.com/GESkunkworks/gossamer) and AWS aliases\nbased on a single configuration file.\n\n## Requirements\n- Python 2.7 or 3.6\n\n It is recommended that you use [`virtualenvwrapper`](http://virtualenvwrapper.readthedocs.io/en/latest/) to separate\n your Python environments.\n\n- [Gossamer](https://github.com/GESkunkworks/gossamer)\n\n## Installation\n\n1. Install the latest release of [Gossamer](https://github.com/GESkunkworks/gossamer#installation)\n\n2. Make sure the path that you saved Gossamer to is in your `$PATH`.\n\n **Linux/Mac:**\n\n Add to your `.bashrc` (Linux) or `.bash_profile` (Mac):\n\n ```\n export PATH=$PATH:\n ```\n\n **Windows:**\n\n https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/\n\n3. Install goss-config-gen\n\n ```\n pip install goss-config-gen\n ```\n\n4. Add the following to the bottom of your `.bash_profile`:\n\n ```\n # Generated aliases\n if [ -f $HOME/gossamer/goss-generated-aliases.sh ]; then\n . $HOME/gossamer/goss-generated-aliases.sh\n fi\n ```\n\n## Configuration\n\nThe configuration file can be specified manually as an argument `--config-file` or `-c`, or it can be set using the\n`GOSS_GEN_CONFIG` environment variable. It defaults to `$HOME/goss-config.json`. This is where `goss-config-gen` by\ndefault expects the configuration file to be stored. A [sample configuration file](goss-config.json) is available\nto get you started. Customize the values as appropriate.\n\n### `OutputDirectory`\nOutput directory that files will be written to.\n\nThis argument is optional and defaults to `$HOME/gossamer`.\n\n### `OutputFile`\nOutput file that will contain all the generated aliases\n\nThis argument is optional and defaults to `goss-generated-aliases.sh`.\n\n### `RoleAliases`\nMapping of aliases to roles.\n\nThis argument is optional and allows for the creation of an alias that maps to one or more roles.\n\n```json\n\"RoleAliases\": {\n \"all\": [\n \"path/role1\",\n \"path/role2\n ]\n}\n```\n\nFor instance, if you are trying to assume roles `path/role1` and `path/role2` in all accounts using the above\nconfiguration, the generated alias would be `goss-all`. In addition to these aliases, by default, an alias for each\nnormalized version (`/`'s are replaced with `-`'s) of a role name will be created.\n\n### `GossamerPath`\n\nPath to the Gossamer executable. Defaults to `/usr/local/bin/gossamer`\n\n### `AWSCredentialsPath`\n\nPath to the AWS credentials file. Defaults to `$HOME/.aws/credentials`\n\n### `AWSCLIPath`\n\nPath to the AWS CLI executable. Defaults to `/usr/local/bin/aws`\n\n### `BaseProfile`\n\nBase profile that has credentials from which roles can be assumed. This profile should already be configured in your\nAWS credentials file. Defaults to \"default\".\n\n### `Accounts`\nList of objects contining information about accounts. This argument is **required**.\n\nBelow is an overview of the fields supported by each object.\n\n| Field | Description | Required | Defaults |\n|--------|----------------------------------------------------------------------------------------------------|----------|---------------------------|\n| Id | Account ID | Yes | |\n| Name | Account Name | Yes | |\n| Alias | String to use in the generated alias (i.e. if this is `r1`, the generated alias will be `goss-r1`) | No | Value of the \"Name\" field |\n| Region | AWS region | Yes | |\n| Role | Role name, including path, to assume | Yes | |\n\n## Usage\n\n1. Run `goss-config-gen`:\n ```\n goss-config-gen\n ```\n\n2. Restart your terminal\n\n3. Use one of the generated aliases. For example, if one of your `Alias`'s is set to `a`, an alias named `goss-a` would be generated. The alias can be used as follows:\n\n ```\n goss-a [enter your MFA code here]\n ```\n\n## Importing existing role files\n\nIf you already have a number of gossamer role files, you can generated a `goss-config-gen` configuration file by\npassing those role files into `goss-config-gen`.\n\nFor example, if you have the following role files:\n\n`role-file-1`\n\n```json\n{\n \"Roles\": [\n {\n \"AccountName\": \"acct-a\",\n \"Region\": \"us-east-1\",\n \"RoleArn\": \"arn:aws:iam::123456789012:role/path/role1\"\n },\n {\n \"AccountName\": \"acct-b\",\n \"Region\": \"us-east-1\",\n \"Role\": \"arn:aws:iam::987654321098:role/path/role1\"\n }\n ]\n}\n```\n\n`role-file-2`\n\n```json\n{\n \"Roles\": [\n {\n \"AccountName\": \"acct-c\",\n \"Region\": \"us-east-1\",\n \"Role\": \"arn:aws:iam::123456789012:role/cs/role2\"\n },\n {\n \"AccountName\": \"acct-d\",\n \"Region\": \"us-east-1\",\n \"Role\": \"arn:aws:iam::111111111111:role/cs/role2\"\n }\n ]\n}\n```\n\nRun the following command to generate the config file:\n```\ngoss-config-gen \\\n --config-file \\\n --import-file \\\n --import-file \n```\n\nNote: The `--config-file` argument is optional and only needed if the config file should be saved to a custom location.\n\n\nIt will generate the following configuration file that can be used for subsequent\n```json\n{\n \"Accounts\": [\n {\n \"Id\": \"123456789012\",\n \"Name\": \"acct-a\",\n \"Region\": \"us-east-1\",\n \"Role\": \"path/role1\"\n },\n {\n \"Id\": \"987654321098\",\n \"Name\": \"acct-b\",\n \"Region\": \"us-east-1\",\n \"Role\": \"path/role1\"\n },\n {\n \"Id\": \"123456789012\",\n \"Name\": \"acct-c\",\n \"Region\": \"us-east-1\",\n \"Role\": \"path/role2\"\n },\n {\n \"Id\": \"111111111111\",\n \"Name\": \"acct-d\",\n \"Region\": \"us-east-1\",\n \"Role\": \"path/role2\"\n }\n ]\n}\n```\n\nNow to generate the aliases with the new configuration file, simply run `goss-config-gen` as normal:\n```\ngoss-config-gen --config-file \n```\n\nNote: Again, the `--config-file` argument is optional and only needed if the config file is stored in a custom location.\n\n### Sample\n\nThe [sample configuration file](goss-config.json) will generate the following aliases:\n\n```bash\ngoss-a\ngoss-b\ngoss-c\ngoss-d\ngoss-e\ngoss-acct-f\n\naws-a\naws-b\naws-c\naws-d\naws-e\naws-acct-f\n\nawsi-a\nawsi-b\nawsi-c\nawsi-d\nawsi-e\nawsi-acct-f\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/GESkunkworks/goss-config-gen", "keywords": "gossamer config aws", "license": "", "maintainer": "", "maintainer_email": "", "name": "goss-config-gen", "package_url": "https://pypi.org/project/goss-config-gen/", "platform": "", "project_url": "https://pypi.org/project/goss-config-gen/", "project_urls": { "Homepage": "https://github.com/GESkunkworks/goss-config-gen" }, "release_url": "https://pypi.org/project/goss-config-gen/1.3.0/", "requires_dist": [ "setuptools-scm (~=3.1.0)", "six (~=1.11.0)" ], "requires_python": "", "summary": "Generate Gossamer config files and AWS aliases", "version": "1.3.0" }, "last_serial": 4508935, "releases": { "1.2.2": [ { "comment_text": "", "digests": { "md5": "9ebebe9a66a737d1254fbcf46a7d4d4f", "sha256": "497dbf306bc5d8716f216bd0a7cfd530ef47cdae2893a51cafb5cd7277ff7424" }, "downloads": -1, "filename": "goss_config_gen-1.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9ebebe9a66a737d1254fbcf46a7d4d4f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7696, "upload_time": "2018-09-28T15:10:46", "url": "https://files.pythonhosted.org/packages/04/bd/da87776ea8192740351679a17f43a96077020b92ba6046e2bcb64ee83891/goss_config_gen-1.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e0f36a06054ffb3142cd3ac1967d5a7", "sha256": "0f802ad0427d77d30b7996747ea5af189e77be3ed6b0a6244ac40b394d6112f0" }, "downloads": -1, "filename": "goss-config-gen-1.2.2.tar.gz", "has_sig": false, "md5_digest": "1e0f36a06054ffb3142cd3ac1967d5a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7777, "upload_time": "2018-09-28T15:10:47", "url": "https://files.pythonhosted.org/packages/59/6a/4e3c1331f365a242e6fbac1ddcddfffecfd10bc92b92399860e19eafc889/goss-config-gen-1.2.2.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "f6bc971540dfcfddbb7293a1a788aeb3", "sha256": "4e710866fb7288114b6c06605a99e37ecdc6001aece392f3ef4c8e0a41715a85" }, "downloads": -1, "filename": "goss_config_gen-1.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "f6bc971540dfcfddbb7293a1a788aeb3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7774, "upload_time": "2018-11-20T19:25:58", "url": "https://files.pythonhosted.org/packages/9f/5c/f63e3367871d8e66bee0a296efd609f22c3224e09eb032c09bcbd63b3d21/goss_config_gen-1.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6194cd59d7f477642dea90ee5f7adf9", "sha256": "de4bc8b44aa66f1b424b46f185f701a8a4b7f693e599bfd04f25b404f7011a36" }, "downloads": -1, "filename": "goss-config-gen-1.3.0.tar.gz", "has_sig": false, "md5_digest": "d6194cd59d7f477642dea90ee5f7adf9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7961, "upload_time": "2018-11-20T19:25:59", "url": "https://files.pythonhosted.org/packages/20/d7/7791116357ccd27f9abf68b589e9b7a7b7339c5a7ab6c8b627a64e4786b1/goss-config-gen-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f6bc971540dfcfddbb7293a1a788aeb3", "sha256": "4e710866fb7288114b6c06605a99e37ecdc6001aece392f3ef4c8e0a41715a85" }, "downloads": -1, "filename": "goss_config_gen-1.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "f6bc971540dfcfddbb7293a1a788aeb3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7774, "upload_time": "2018-11-20T19:25:58", "url": "https://files.pythonhosted.org/packages/9f/5c/f63e3367871d8e66bee0a296efd609f22c3224e09eb032c09bcbd63b3d21/goss_config_gen-1.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6194cd59d7f477642dea90ee5f7adf9", "sha256": "de4bc8b44aa66f1b424b46f185f701a8a4b7f693e599bfd04f25b404f7011a36" }, "downloads": -1, "filename": "goss-config-gen-1.3.0.tar.gz", "has_sig": false, "md5_digest": "d6194cd59d7f477642dea90ee5f7adf9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7961, "upload_time": "2018-11-20T19:25:59", "url": "https://files.pythonhosted.org/packages/20/d7/7791116357ccd27f9abf68b589e9b7a7b7339c5a7ab6c8b627a64e4786b1/goss-config-gen-1.3.0.tar.gz" } ] }