ecs-service-discovery


Nameecs-service-discovery JSON
Version 0.1.2 PyPI version JSON
download
home_page
SummaryECS Service Discovery
upload_time2023-04-16 14:15:05
maintainer
docs_urlNone
authorJohn Preston
requires_python>=3.8,<4.0
licenseMPL-2.0
keywords ecs service discovery observability
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =====================
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": "",
    "name": "ecs-service-discovery",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "ecs,service discovery,observability",
    "author": "John Preston",
    "author_email": "john@ews-network.net",
    "download_url": "https://files.pythonhosted.org/packages/d0/c3/d5c4d4a7115927f23e334899528c39d057650bb4113b9b07c619695d6cf8/ecs_service_discovery-0.1.2.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.2",
    "split_keywords": [
        "ecs",
        "service discovery",
        "observability"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4e9d57fe51421ef607060d120800e4f817b1cd3119be9480532ff86f600352dd",
                "md5": "81e87a446ea71f2241ffb5e4dbf9e2d8",
                "sha256": "fdeb872b756f2b8831169d15ecfdab237529db5c9790d314255a12492fc6f68a"
            },
            "downloads": -1,
            "filename": "ecs_service_discovery-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "81e87a446ea71f2241ffb5e4dbf9e2d8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 15735,
            "upload_time": "2023-04-16T14:15:01",
            "upload_time_iso_8601": "2023-04-16T14:15:01.308671Z",
            "url": "https://files.pythonhosted.org/packages/4e/9d/57fe51421ef607060d120800e4f817b1cd3119be9480532ff86f600352dd/ecs_service_discovery-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d0c3d5c4d4a7115927f23e334899528c39d057650bb4113b9b07c619695d6cf8",
                "md5": "ab638c723f392965b1e0e160bf8d041b",
                "sha256": "adca538082a5aa19365da90a9fd7732d0257de109b92c39345834bf0b9c1cabb"
            },
            "downloads": -1,
            "filename": "ecs_service_discovery-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ab638c723f392965b1e0e160bf8d041b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 14937,
            "upload_time": "2023-04-16T14:15:05",
            "upload_time_iso_8601": "2023-04-16T14:15:05.468301Z",
            "url": "https://files.pythonhosted.org/packages/d0/c3/d5c4d4a7115927f23e334899528c39d057650bb4113b9b07c619695d6cf8/ecs_service_discovery-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-16 14:15:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "ecs-service-discovery"
}
        
Elapsed time: 0.05490s