{ "info": { "author": "Tamirlan Torgayev", "author_email": "torgayev@me.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# aws-eden-cli: ECS Dynamic Environment Manager [![PyPi version](https://img.shields.io/pypi/v/aws-eden-cli.svg)](https://pypi.python.org/pypi/aws-eden-cli/) ![](https://img.shields.io/badge/python-3.6+-blue.svg) ![t](https://img.shields.io/badge/status-beta-orange.svg) \n\n\nClone ECS environments easily. \nProvide eden with a sample ECS service and eden will clone it. \n\neden is provided in CLI and Terraform module (Lambda with HTTP API) flavors. \nYou can use HTTP API from CI of your choice on Pull Request open/close, \nnew commit pushes to fully automate environment creation. \nFor API flavor, see eden API at [GitHub](https://github.com/baikonur-oss/terraform-aws-lambda-eden-api).\n\nWorks only with Python 3.6+.\n\n## Developing with eden\n\n![simple-figure](figures/aws-eden-simple-en.png)\n\n## Requirements:\n1. Config JSON file in a S3 bucket with structure described below\n2. A reference ECS Service with Target Group Attached\n3. An ALB with HTTPS Listener\n - will be reused by all environments with Host Header Listener Rules\n4. Simple ALB usage\n - no multiple path rules etc.\n - one ALB per one ECS Service\n\n## What it does\n### Resources created/deleted\neden creates\n1. ECS Task Definition \n - cloned from reference service\n2. ALB (elbv2) Target Group \n - settings cloned from Target Group attached to reference service\n3. ECS Service\n - created in the same cluster as reference service\n4. ALB Listener Rule\n - Host Header rule\n5. Route 53 CNAME record\n - points to common ALB\n6. An entry is added to config JSON file\n\neden deletes resources as in list above but in reverse order.\n\n### Config JSON file\nConfig file is used to:\n1. Check what environments exist and where their endpoints are\n2. Tell client apps what is available\n\nConfig file format:\n```json\n{\n \"environments\": [\n {\n \"env\": \"dev\",\n \"name\": \"dev-dynamic-test\",\n \"api_endpoint\": \"api-test.dev.example.com\"\n }\n ]\n}\n```\nExample above presumes `config_update_key = api_endpoint`. You can use multiple Lambdas/invoke eden-cli multiple times with different update keys to have multiple endpoints within single environment.\n\nFor example, you may want to have API, administration tool and a frontend service created as a single environment. Your environment file could look like this:\n```json\n{\n \"environments\": [\n {\n \"env\": \"dev\",\n \"name\": \"dev-dynamic-test\",\n \"api_endpoint\": \"api-test.dev.example.com\",\n \"admin_endpoint\": \"admin-test.dev.example.com\",\n \"frontend_endpoint\": \"test.dev.example.com\"\n }\n ]\n}\n```\n\n## Usage (CLI interface)\n### Installation\n```\n$ pip3 install aws-eden-cli \n\n$ eden -h\nusage: eden [-h] [-p PROFILE] [-c CONFIG_PATH] [-v] {config,create,delete} ...\n\ncreate similar ecs environments easily.\n\npositional arguments:\n {config,create,delete}\n config configure eden\n create create environment or deploy to existent\n delete delete environment\n\noptional arguments:\n -h, --help show this help message and exit\n -p PROFILE, --profile PROFILE\n profile name in eden configuration file\n -c CONFIG_PATH, --config-path CONFIG_PATH\n eden configuration file path\n -v, --verbose\n```\n\n### Configure\n```\n$ eden config --config-bucket-key endpoints.json\n$ eden config --config-bucket-name servicename-config\n$ eden config --config-update-key api_endpoint\n$ eden config --config-name-prefix servicename-dev\n$ eden config --domain-name-prefix api\n$ eden config --dynamic-zone-id Zxxxxxxxxxxxx\n$ eden config --dynamic-zone-name dev.example.com.\n$ eden config --master-alb-arn arn:aws:elasticloadbalancing:ap-northeast-1:xxxxxxxxxxxx:loadbalancer/app/dev-alb-api-dynamic/xxxxxxxxxx\n$ eden config --name-prefix dev-dynamic\n$ eden config --reference-service-arn arn:aws:ecs:ap-northeast-1:xxxxxxxxxxxx:service/dev/dev01-api\n$ eden config --target-cluster dev\n$ eden config --target-container-name api\n\n# you can also edit ~/.eden/config directly\n\n$ cat ~/.eden/config\n[default]\nname_prefix = dev-dynamic\nreference_service_arn = arn:aws:ecs:ap-northeast-1:xxxxxxxxxxxx:service/dev/dev01-api\ntarget_cluster = dev\ndomain_name_prefix = api\nmaster_alb_arn = arn:aws:elasticloadbalancing:ap-northeast-1:xxxxxxxxxxxx:loadbalancer/app/dev-alb-api-dynamic/xxxxxxxxxx\ndynamic_zone_name = dev.example.com.\ndynamic_zone_id = Zxxxxxxxxxxxx\nconfig_bucket_name = servicename-config\nconfig_bucket_key = endpoints.json\nconfig_update_key = api_endpoint\nconfig_env_type = dev\nconfig_name_prefix = servicename-dev\ntarget_container_name = api\n\n# don't forget to check configuration file integrity\n\n$ eden config --check\nNo errors found\n\n# you can specify multiple profiles in configuration\n# and select a profile with -p profile_name\n\n$ eden config --check -p default\nNo errors found\n```\n\n### Execute commands\n```\n$ eden create --name test --cirn xxxxxxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/servicename-api-dev:latest\nChecking if image xxxxxxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/servicename-api-dev:latest exists\nImage exists\nRetrieved reference service arn:aws:ecs:ap-northeast-1:xxxxxxxxxxxx:service/dev/dev01-api\nRetrieved reference task definition from arn:aws:ecs:ap-northeast-1:xxxxxxxxxxxx:task-definition/dev01-api:15\nRegistered new task definition: arn:aws:ecs:ap-northeast-1:xxxxxxxxxxxx:task-definition/dev-dynamic-test:4\nRegistered new task definition: arn:aws:ecs:ap-northeast-1:xxxxxxxxxxxx:task-definition/dev-dynamic-test:4\nRetrieved reference target group: arn:aws:elasticloadbalancing:ap-northeast-1:xxxxxxxxxxxx:targetgroup/dev01-api/9c68a5f91f34d9a4\nExisting target group dev-dynamic-test not found, will create new\nCreated target group arn:aws:elasticloadbalancing:ap-northeast-1:xxxxxxxxxxxx:targetgroup/dev-dynamic-test/1c68c9e4c711a1f4\nELBv2 listener rule for target group arn:aws:elasticloadbalancing:ap-northeast-1:xxxxxxxxxxxx:targetgroup/dev-dynamic-test/1c68c9e4c711a1f4 and host api-test.dev.example.com does not exist, will create new listener rule\nECS Service dev-dynamic-test does not exist, will create new service\nChecking if record api-test.dev.example.com. exists in zone Zxxxxxxxxxxxx\nSuccessfully created CNAME: api-test.dev.example.com -> dev-alb-api-dynamic-xxxxxxxxx.ap-northeast-1.elb.amazonaws.com\nUpdating config file s3://servicename-config/endpoints.json, environment dev-dynamic-test: api_endpoint -> api-test.dev.example.com\nExisting environment not found, adding new\nSuccessfully updated config file\nSuccessfully finished creating environment dev-dynamic-test\n\n$ eden delete --name test\nUpdating config file s3://servicename-config/endpoints.json, delete environment dev-dynamic-test: api_endpoint -> api-test.dev.example.com\nExisting environment found, and the only optional key is api_endpoint,deleting environment\nSuccessfully updated config file\nChecking if record api-test.dev.example.com. exists in zone Zxxxxxxxxxxxx\nFound existing record api-test.dev.example.com. in zone Zxxxxxxxxxxxx\nSuccessfully removed CNAME record api-test.dev.example.com\nECS Service dev-dynamic-test exists, will delete\nSuccessfully deleted service dev-dynamic-test from cluster dev\nELBv2 listener rule for target group arn:aws:elasticloadbalancing:ap-northeast-1:xxxxxxxxxxxx:targetgroup/dev-dynamic-test/1c68c9e4c711a1f4 and host api-test.dev.example.com found, will delete\nDeleted target group arn:aws:elasticloadbalancing:ap-northeast-1:xxxxxxxxxxxx:targetgroup/dev-dynamic-test/1c68c9e4c711a1f4\nDeleted all task definitions for family: dev-dynamic-test, 1 tasks deleted total\nSuccessfully finished deleting environment dev-dynamic-test\n```\n\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/baikonur-oss/aws-eden-cli", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aws-eden-cli", "package_url": "https://pypi.org/project/aws-eden-cli/", "platform": "", "project_url": "https://pypi.org/project/aws-eden-cli/", "project_urls": { "Homepage": "https://github.com/baikonur-oss/aws-eden-cli", "Source Code": "https://github.com/baikonur-oss/aws-eden-cli" }, "release_url": "https://pypi.org/project/aws-eden-cli/0.1.1/", "requires_dist": [ "aws-eden-core (==0.1.0)" ], "requires_python": "", "summary": "ECS Dynamic Environment Manager (eden) CLI", "version": "0.1.1" }, "last_serial": 5713858, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "79e3247a804f3f61d85bd417303964f4", "sha256": "5f88c26f5f74738960b16acdb321315630a207ee4b29e9f4c60cce81e7d789f0" }, "downloads": -1, "filename": "aws_eden_cli-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "79e3247a804f3f61d85bd417303964f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8033, "upload_time": "2019-08-22T08:15:20", "url": "https://files.pythonhosted.org/packages/b8/a5/76c7e070a32b1e02c3480b16acd6e7f0842abe9c639da66219338b7f83bc/aws_eden_cli-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "51310c485d3bbe1a236513acf390ea9f", "sha256": "829eb83598f6ddf03c7813f64c66e9a6fe5cd858824debede1504ce48414239e" }, "downloads": -1, "filename": "aws_eden_cli-0.1.1.tar.gz", "has_sig": false, "md5_digest": "51310c485d3bbe1a236513acf390ea9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7570, "upload_time": "2019-08-22T08:15:23", "url": "https://files.pythonhosted.org/packages/ff/38/e61b48328cf92dfa53f4e8b3acd181647a3f05360b7a8741d3fc1947d388/aws_eden_cli-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "79e3247a804f3f61d85bd417303964f4", "sha256": "5f88c26f5f74738960b16acdb321315630a207ee4b29e9f4c60cce81e7d789f0" }, "downloads": -1, "filename": "aws_eden_cli-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "79e3247a804f3f61d85bd417303964f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8033, "upload_time": "2019-08-22T08:15:20", "url": "https://files.pythonhosted.org/packages/b8/a5/76c7e070a32b1e02c3480b16acd6e7f0842abe9c639da66219338b7f83bc/aws_eden_cli-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "51310c485d3bbe1a236513acf390ea9f", "sha256": "829eb83598f6ddf03c7813f64c66e9a6fe5cd858824debede1504ce48414239e" }, "downloads": -1, "filename": "aws_eden_cli-0.1.1.tar.gz", "has_sig": false, "md5_digest": "51310c485d3bbe1a236513acf390ea9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7570, "upload_time": "2019-08-22T08:15:23", "url": "https://files.pythonhosted.org/packages/ff/38/e61b48328cf92dfa53f4e8b3acd181647a3f05360b7a8741d3fc1947d388/aws_eden_cli-0.1.1.tar.gz" } ] }