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
docker run --rm -it -v ~/.aws:/root/.aws public.ecr.aws/compose-x/ecs-service-discovery
Python
For your user only
pip install pip --user ecs-service-discovery
Via virtual environment
pip install ecs-service-discovery
Usage
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
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
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: '*'
Metadata
Release files for ecs_service_discovery 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ecs_service_discovery-0.1.4.tar.gz | 14.5 kB | Without provenance | Details for ecs_service_discovery-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ecs_service_discovery-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for ecs_service_discovery-0.1.4-py3-none-any.whl |
Total release size: 30.4 kB
Release files / ecs_service_discovery-0.1.4.tar.gz
| Download URL | ecs_service_discovery-0.1.4.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0c36665dc52d6af254cd280e395780249b5cf13734c5e8fc96380ef54d4daa0
|
|
BLAKE2b-256 checksum How to use checksums |
0956134cf3db71544ff7bd446ce6a3ffe74760bd6c11a0b00cb069605be03aa4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.3 Linux/6.8.10-200.fc39.x86_64
|
Release files / ecs_service_discovery-0.1.4-py3-none-any.whl
| Download URL | ecs_service_discovery-0.1.4-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af2fd10bab5dfd5708fbffa1f76a09e900b26d49cb68bdce8b214b963a6060be
|
|
BLAKE2b-256 checksum How to use checksums |
0f285b702a6cff11d25be4e02514d257ee4ba75e622014128df673dae3585399
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.3 Linux/6.8.10-200.fc39.x86_64
|
Security for ecs_service_discovery 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.