{
"info": {
"author": "Drew J. Sonne",
"author_email": "drew.sonne@gmail.com",
"bugtrack_url": null,
"classifiers": [],
"description": "aws-autodiscovery-templater\n===========================\n\nAuto discovery in AWS can be tricky for legacy applications. Due to time\nor complexity, it's not always possible to write auto discovery code to\nlet applications find each other in an elastic/scaling environment.\nSometimes, listing the ips/hosts for hosts in a config file will be\nenough, and that's what this script does.\n\nInstallation\n============\n\nInstallation is simply\n\n::\n\n $ pip install aws-autodiscovery-templater\n\nUsage\n=====\n\nThe easiest way is to use the included cli tool (although there is a\nsmall python library which you can use). This project uses the `jinja2\ntemplating engine `__, so you can find\ndetails there about how to write templates. The following variables are\npassed to the templating engine:\n\n::\n\n {\n \"private\": {\n \"ips\": [...],\n \"hostnames\": [...]\n },\n \"public\": {\n \"ips\": [...],\n \"hostnames\": [...]\n },\n \"reservations\": {\n ...\n }\n }\n\nThe first two entries, contain an array of strings for public and\nprivate, ips and hostnames. The reservations entry contains the raw\noutput from\n`EC2.Client.describe\\_instances `__.\n\nFrom this, we can create a template that looks like this\n\n::\n\n # /path/to/config.yaml\n {% if private['ips'] %}\n private_ips:{% for ip in private['ips'] %}\n - {{ ip }}{% endfor %}{% endif %}\n\nWe'll be using this template in the following examples.\n\n*Note:* Before you run any of this, you need to have either your AWS\ncredentials set up in ``~/.aws/{config,credentials}``, or in ``AWS_*``\nenvironment variables.\n\nExample run\n-----------\n\n::\n\n $ aws-autodiscovery-templater \\\n --template-path /path/to/config.yaml \\ # Path to jina2 formatted template\n --profile my-aws-profile \\ # AWS credentials as defined in ~/.aws/credentials\n --stdout \\ # Print result to stdout\n --filter-empty # Don't include null/missing values (eg. not all machines have public IPs\n\nFiltering instances\n-------------------\n\nMore importantly, you can filter instances based on their tags. This\nfilter is a json objectstructured in the same manner as described in\n`aws ec2\ndescribe-instances `__,\nexcluding the root ``[\"Reservations\"]`` key.\n\n::\n\n $ aws-autodiscovery-templater \\\n --template-path /path/to/config.yaml \\ \n --profile my-aws-profile \\\n --stdout \\\n --filter-empty\n --filter \"Name=tag:Application,Values=[mongodb,mongodb-master]\"\n private_ips:\n - 10.0.0.20\n - 10.0.0.10\n - 10.0.0.30\n \n\nInline help:\n------------\n\n::\n\n # For more details, have a look at the --help option\n $ aws-autodiscovery-templater --help\n usage: aws-autodiscovery-templater [-h]\n [--aws-access-key-id AWS_ACCESS_KEY_ID]\n [--aws-secret-access-key AWS_SECRET_ACCESS_KEY]\n [--aws-session-token AWS_SESSION_TOKEN]\n [--region REGION] [--profile PROFILE]\n [--role ROLE] [--auth-debug]\n [--role-session-name ROLE_SESSION_NAME]\n --template-path TEMPLATE_PATH --stdout\n [--vpc-ids] [--filter FILTER]\n [--filter-empty]\n\n optional arguments:\n -h, --help show this help message and exit\n\n AWS credentials:\n --aws-access-key-id AWS_ACCESS_KEY_ID\n AWS access key\n --aws-secret-access-key AWS_SECRET_ACCESS_KEY\n Access and secret key variables override credentials\n stored in credential and config files\n --aws-session-token AWS_SESSION_TOKEN\n A session token is only required if you are using\n temporary security credentials.\n --region REGION This variable overrides the default region of the in-\n use profile, if set.\n --profile PROFILE This can be the name of a profile stored in a\n credential or config file, or default to use the\n default profile.\n --role ROLE Fully qualified role arn to assume\n --auth-debug Enter debug mode, which will print credentials and\n then exist at `create_session`.\n --role-session-name ROLE_SESSION_NAME\n If you have assigned a role, set a --role-session-name\n\n AWS Autodiscovery Templater:\n --template-path TEMPLATE_PATH\n Path to the template to fill variables into.\n --stdout Prints a json object containing the retrieves\n resources\n --vpc-ids Optionally restrict the filtering to a particular list\n of IPs. Comma seperated list of vpc-ids.\n --filter FILTER Filter for ec2 instances as defined in http://boto3.re\n adthedocs.org/en/latest/reference/services/ec2.html#EC\n 2.Client.describe_instances\n --filter-empty By default, missing values are returned as null to\n keep private/public ip/hostname sets of equal length.\n This removes null values from the filter\n",
"description_content_type": null,
"docs_url": null,
"download_url": "https://github.com/drewsonne/aws-autodiscovery-templater/tarball/1.0.1",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/drewsonne/aws-autodiscovery-templater",
"keywords": "",
"license": "",
"maintainer": "",
"maintainer_email": "",
"name": "aws-autodiscovery-templater",
"package_url": "https://pypi.org/project/aws-autodiscovery-templater/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/aws-autodiscovery-templater/",
"project_urls": {
"Download": "https://github.com/drewsonne/aws-autodiscovery-templater/tarball/1.0.1",
"Homepage": "https://github.com/drewsonne/aws-autodiscovery-templater"
},
"release_url": "https://pypi.org/project/aws-autodiscovery-templater/1.0.1/",
"requires_dist": null,
"requires_python": "",
"summary": "",
"version": "1.0.1"
},
"last_serial": 1836070,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "1aaf9ee976646b918ea781564d94b9cc",
"sha256": "061b48890e2aac16483d56ef926586673d6f395f0ce840ce04f9ef76dae847bd"
},
"downloads": -1,
"filename": "aws-autodiscovery-templater-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "1aaf9ee976646b918ea781564d94b9cc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7829,
"upload_time": "2015-11-27T09:40:53",
"url": "https://files.pythonhosted.org/packages/5e/21/61fc828ba52833572c7b5413c032db3383ea7268dcbeef892de015f69efc/aws-autodiscovery-templater-1.0.0.tar.gz"
}
],
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "a65452ff2a6444131ed0d5953a5c854f",
"sha256": "f056af4ee5a7794824f4ef1ad584d34f368b20ba8dcabe6bcf9b5179412640a9"
},
"downloads": -1,
"filename": "aws-autodiscovery-templater-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "a65452ff2a6444131ed0d5953a5c854f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7866,
"upload_time": "2015-11-27T09:54:07",
"url": "https://files.pythonhosted.org/packages/f3/94/3ea11effcf305f9a5b27e576a97aac5b9aa3db9a4234ba16fc78ed011276/aws-autodiscovery-templater-1.0.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "a65452ff2a6444131ed0d5953a5c854f",
"sha256": "f056af4ee5a7794824f4ef1ad584d34f368b20ba8dcabe6bcf9b5179412640a9"
},
"downloads": -1,
"filename": "aws-autodiscovery-templater-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "a65452ff2a6444131ed0d5953a5c854f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7866,
"upload_time": "2015-11-27T09:54:07",
"url": "https://files.pythonhosted.org/packages/f3/94/3ea11effcf305f9a5b27e576a97aac5b9aa3db9a4234ba16fc78ed011276/aws-autodiscovery-templater-1.0.1.tar.gz"
}
]
}