=====================
ECS Service Discovery
=====================
.. image:: https://img.shields.io/pypi/v/ecs_service_discovery.svg
:target: https://pypi.python.org/pypi/ecs_service_discovery
Yet another tool to perform ECS API based service discovery.
Primarily aimed at gapping the lack of integrations for ECS Anywhere.
Features
==========
* Creates Prometheus scraping configuration, from scanning ECS clusters & services, based on docker labels
Installation
==============
Docker
--------
Head to `Public ECR`_ to obtain the image
.. code-block::
docker run --rm -it -v ~/.aws:/root/.aws public.ecr.aws/compose-x/ecs-service-discovery
Python
---------
For your user only
.. code-block::
pip install pip --user ecs-service-discovery
Via virtual environment
.. code-block::
pip install ecs-service-discovery
Usage
=======
.. code-block::
usage: ecs-sd [-h] [-d OUTPUT_DIR] [--profile PROFILE] [-p PROMETHEUS_PORT] [--intervals INTERVALS] [--prometheus-output-format PROMETHEUS_OUTPUT_FORMAT] [_ ...]
positional arguments:
_
options:
-h, --help show this help message and exit
-d OUTPUT_DIR, --output_dir OUTPUT_DIR
--profile PROFILE aws profile to use. Defaults to SDK default behaviour
-p PROMETHEUS_PORT, --prometheus-port PROMETHEUS_PORT
--intervals INTERVALS
Time between ECS discovery intervals
--prometheus-output-format PROMETHEUS_OUTPUT_FORMAT
Change the format of generated files. JSON or YAML.
Examples
==========
ECS Compose-X
-----------------
Install `ecs-compose-x`_ & deploy to AWS
.. hint::
you will need to use the `x-vpc`_ extension to deploy the service in the right VPC to get prometheus scraping.
you can use the `x-cluster`_ extension to specify the ECS Cluster you want to deploy the service to.
Docker Compose
-----------------
After cloning the repository, run `docker compose up`. It will spin the service discovery, along with prometheus & grafana to run the demo with.
You can access prometheus via `localhost:9090` and grafana via `localhost:3000` (admin:admin by default).
In prometheus, you can look at the configuration and service discovery. You should see the discovered targets that prometheus is going to try
to scrape.
AWS Policy requirements
=========================
.. code-block:: yaml
PolicyName: ECSServiceDiscoverySimple
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- ecs:ListClusters
- ecs:ListContainerInstances
- ecs:ListTasks
- ecs:DescribeContainerInstances
- ssm:DescribeInstanceInformation
- ecs:DescribeTasks
- ecs:DescribeTaskDefinition
Resource: '*'
.. _Public ECR: https://gallery.ecr.aws/compose-x/ecs-service-discovery
.. _ecs-compose-x: https://docs.compose-x.io/installation.html
.. _x-cluster: https://docs.compose-x.io/syntax/compose_x/ecs_cluster.html
.. _x-vpc: https://docs.compose-x.io/syntax/compose_x/vpc.html
Raw data
{
"_id": null,
"home_page": null,
"name": "ecs_service_discovery",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "ecs, service discovery, observability",
"author": "John Preston",
"author_email": "john@ews-network.net",
"download_url": "https://files.pythonhosted.org/packages/09/56/134cf3db71544ff7bd446ce6a3ffe74760bd6c11a0b00cb069605be03aa4/ecs_service_discovery-0.1.4.tar.gz",
"platform": null,
"description": "=====================\nECS Service Discovery\n=====================\n\n.. image:: https://img.shields.io/pypi/v/ecs_service_discovery.svg\n :target: https://pypi.python.org/pypi/ecs_service_discovery\n\nYet another tool to perform ECS API based service discovery.\nPrimarily aimed at gapping the lack of integrations for ECS Anywhere.\n\nFeatures\n==========\n\n* Creates Prometheus scraping configuration, from scanning ECS clusters & services, based on docker labels\n\nInstallation\n==============\n\nDocker\n--------\n\nHead to `Public ECR`_ to obtain the image\n\n.. code-block::\n\n docker run --rm -it -v ~/.aws:/root/.aws public.ecr.aws/compose-x/ecs-service-discovery\n\n\nPython\n---------\n\nFor your user only\n\n.. code-block::\n\n pip install pip --user ecs-service-discovery\n\nVia virtual environment\n\n.. code-block::\n\n pip install ecs-service-discovery\n\n\nUsage\n=======\n\n.. code-block::\n\n usage: ecs-sd [-h] [-d OUTPUT_DIR] [--profile PROFILE] [-p PROMETHEUS_PORT] [--intervals INTERVALS] [--prometheus-output-format PROMETHEUS_OUTPUT_FORMAT] [_ ...]\n\n positional arguments:\n _\n\n options:\n -h, --help show this help message and exit\n -d OUTPUT_DIR, --output_dir OUTPUT_DIR\n --profile PROFILE aws profile to use. Defaults to SDK default behaviour\n -p PROMETHEUS_PORT, --prometheus-port PROMETHEUS_PORT\n --intervals INTERVALS\n Time between ECS discovery intervals\n --prometheus-output-format PROMETHEUS_OUTPUT_FORMAT\n Change the format of generated files. JSON or YAML.\n\nExamples\n==========\n\nECS Compose-X\n-----------------\n\nInstall `ecs-compose-x`_ & deploy to AWS\n\n.. hint::\n\n you will need to use the `x-vpc`_ extension to deploy the service in the right VPC to get prometheus scraping.\n you can use the `x-cluster`_ extension to specify the ECS Cluster you want to deploy the service to.\n\nDocker Compose\n-----------------\n\nAfter cloning the repository, run `docker compose up`. It will spin the service discovery, along with prometheus & grafana to run the demo with.\nYou can access prometheus via `localhost:9090` and grafana via `localhost:3000` (admin:admin by default).\n\nIn prometheus, you can look at the configuration and service discovery. You should see the discovered targets that prometheus is going to try\nto scrape.\n\nAWS Policy requirements\n=========================\n\n.. code-block:: yaml\n\n PolicyName: ECSServiceDiscoverySimple\n PolicyDocument:\n Version: \"2012-10-17\"\n Statement:\n - Effect: Allow\n Action:\n - ecs:ListClusters\n - ecs:ListContainerInstances\n - ecs:ListTasks\n - ecs:DescribeContainerInstances\n - ssm:DescribeInstanceInformation\n - ecs:DescribeTasks\n - ecs:DescribeTaskDefinition\n Resource: '*'\n\n\n.. _Public ECR: https://gallery.ecr.aws/compose-x/ecs-service-discovery\n.. _ecs-compose-x: https://docs.compose-x.io/installation.html\n.. _x-cluster: https://docs.compose-x.io/syntax/compose_x/ecs_cluster.html\n.. _x-vpc: https://docs.compose-x.io/syntax/compose_x/vpc.html\n",
"bugtrack_url": null,
"license": "MPL-2.0",
"summary": "ECS Service Discovery",
"version": "0.1.4",
"project_urls": {
"Blog": "https://blog.compose-x.io/",
"Bug Tracker": "https://github.com/compose-x/ecs-service-discovery/issues",
"Labs": "https://labs.compose-x.io/",
"Source": "https://github.com/compose-x/ecs-service-discovery/"
},
"split_keywords": [
"ecs",
" service discovery",
" observability"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0f285b702a6cff11d25be4e02514d257ee4ba75e622014128df673dae3585399",
"md5": "22541f6ebbbe36359861326c66da26fa",
"sha256": "af2fd10bab5dfd5708fbffa1f76a09e900b26d49cb68bdce8b214b963a6060be"
},
"downloads": -1,
"filename": "ecs_service_discovery-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "22541f6ebbbe36359861326c66da26fa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 15837,
"upload_time": "2024-05-31T04:28:36",
"upload_time_iso_8601": "2024-05-31T04:28:36.374382Z",
"url": "https://files.pythonhosted.org/packages/0f/28/5b702a6cff11d25be4e02514d257ee4ba75e622014128df673dae3585399/ecs_service_discovery-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0956134cf3db71544ff7bd446ce6a3ffe74760bd6c11a0b00cb069605be03aa4",
"md5": "1a5ca2b80091bb4cbf9cf733ca2700e2",
"sha256": "f0c36665dc52d6af254cd280e395780249b5cf13734c5e8fc96380ef54d4daa0"
},
"downloads": -1,
"filename": "ecs_service_discovery-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "1a5ca2b80091bb4cbf9cf733ca2700e2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 14541,
"upload_time": "2024-05-31T04:28:38",
"upload_time_iso_8601": "2024-05-31T04:28:38.143654Z",
"url": "https://files.pythonhosted.org/packages/09/56/134cf3db71544ff7bd446ce6a3ffe74760bd6c11a0b00cb069605be03aa4/ecs_service_discovery-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-31 04:28:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "compose-x",
"github_project": "ecs-service-discovery",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ecs_service_discovery"
}