{"id":22899718,"url":"https://github.com/meap/runecs","last_synced_at":"2025-05-08T01:10:06.370Z","repository":{"id":41876032,"uuid":"430431397","full_name":"meap/runecs","owner":"meap","description":"Effortlessly Execute One-Off Tasks and Database Migrations in Your ECS Cluster.","archived":false,"fork":false,"pushed_at":"2025-02-27T08:42:08.000Z","size":488,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T01:09:42.571Z","etag":null,"topics":["aws","cli","container","docker","ecs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-21T17:17:04.000Z","updated_at":"2025-02-27T08:42:11.000Z","dependencies_parsed_at":"2024-09-13T13:43:23.576Z","dependency_job_id":"8883ee4b-2cbb-4256-bdde-61a3c82f7f08","html_url":"https://github.com/meap/runecs","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meap%2Frunecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meap%2Frunecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meap%2Frunecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meap%2Frunecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meap","download_url":"https://codeload.github.com/meap/runecs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252978768,"owners_count":21834916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cli","container","docker","ecs"],"created_at":"2024-12-14T01:16:04.155Z","updated_at":"2025-05-08T01:10:06.354Z","avatar_url":"https://github.com/meap.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg width=\"106px\" alt=\"elastic container service logo\" src=\"images/amazon_ecs-icon.svg\"\u003e\n\n# RunECS CLI - Simplified AWS ECS Run Task Wrapper\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/meap/runecs?logo=GitHub)](https://github.com/meap/runecs/releases)\n[![GitHub all releases](https://img.shields.io/github/downloads/meap/runecs/total?label=all%20time%20downloads)](https://github.com/meap/runecs/releases/)\n\nRunECS: Effortlessly Execute One-Off Tasks and Database Migrations in Your ECS Cluster. A developer-friendly wrapper for the AWS ECS run task command.\n\n\u003c/div\u003e\n\n\u003cp\u003e\n    \u003cimg src=\"./images/demo.gif\" width=\"100%\" alt=\"RunECS - Simplified AWS ECS run task demonstration\"\u003e\n\u003c/p\u003e\n\n## What is RunECS?\n\nRunECS is a command-line tool that simplifies running one-off tasks in Amazon ECS (Elastic Container Service). It wraps the standard `aws ecs run-task` command functionality with a more developer-friendly interface, providing intuitive commands for common ECS operations while leveraging AWS's underlying infrastructure.\n\n# Install\n\n## 🍺 Homebrew\n\n```shell\nbrew tap meap/runecs\nbrew install runecs\n```\n\n## Using Docker\n\nThe easiest way to get started with runecs using Docker is by running this command.\n\n```\ndocker run \\\n  -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \\\n  -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \\\n  -e AWS_REGION=$AWS_REGION \\\n  preichl/runecs list\n```\n\n\u003e Note: You have to pass the environment variables with AWS credentials. I recommend using [direnv](https://direnv.net/) which I mentioned in the [introduction post](https://dev.to/preichl/streamline-your-ecs-workflow-easy-database-migrations-with-a-runecs-cli-tool-5d2h).\n\n## 📦 Other way\n\nDownload the binary file for your platform, [see releases](https://github.com/meap/runecs/releases).\n\n\n# How to Use\n\nRunECS simplifies the process of executing commands using AWS ECS run task functionality. The service must be specified in `cluster/service` format. Further, you must specify the environment variables that determine access to AWS.\n\n```\nexport AWS_ACCESS_KEY_ID=xxxxxx\nexport AWS_SECRET_ACCESS_KEY=xxxxxxx\nexport AWS_REGION=eu-east1\n\nrunecs rake orders:upload[14021] --service my-cluster/my-service -w\n```\n\n## Commands\n\n### Run (AWS ECS Run Task Made Simple)\n\nThe `run` command is a streamlined wrapper around the AWS ECS run task API. It executes the process using the last available task definition. You can pick a specific docker tag by using the `--image-tag` argument. In this case, it changes the task definition and inserts the specified docker tag. \n\nThe task is run asynchronously by default. Using the `--wait` argument, the task starts synchronously and returns the EXIT code of the container.\n\nExecuting a one-off process asynchronously:\n\n```shell\nrunecs run rake db:migrate \\\n  --service my-cluster/my-service \\\n  --image-tag latest\n```\n\nExecuting a one-off process synchronously:\n\n```shell\nrunecs run rake db:migrate \\\n  --service my-cluster/my-service \\\n  --image-tag latest \\\n  --wait\n```\n\n### List\n\nThe main parameter is the name of the ECS service within which the command is to be executed. The parameter value consists of the cluster name and its service. To make it easier, we have introduced a command **list** that lists all these services in the specified region.\n\n```shell\nrunecs list\n```\n\nTo include the tasks of each service in the output, use the `--all` parameter. This will display the tasks currently running in each service.\n\n```shell\nrunecs list --all\n```\n\n### Restart\n\nRestarts all running tasks in the service.\n\n```shell\nrunecs restart --service my-cluster/myservice\n```\n\nThe services restart without downtime. The command initiates new tasks using the last definition. After reaching the running state, ECS automatically shuts down old tasks to achieve the desired number of running tasks.\n\nAnother option is to use the `--kill` parameter, which shuts down running tasks in the service. If the service has health checks set up properly, ECS automatically starts new tasks to ensure that the desired number of tasks are running.\n\n```shell\nrunecs restart --service my-cluster/myservice --kill\n```\n\n### Prune\n\n[Deregisters](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeregisterTaskDefinition.html) old task definitions.\n\nUse `--keep-last` and `--keep-days` to ensure that a certain number of definitions are always available.\n\n```shell\nrunecs prune \\\n  --service my-cluster/my-service \\\n  --keep-last 10 --keep-days 5\n```\n\n### Deploy\n\nCreates a new task definition with the specified image tag and updates the service to use the created task definition for new tasks.\n\n```shell\nrunecs deploy \\\n  --service my-cluster/my-service \\\n  --image-tag latest\n```\n\n### Revisions\n\nPrints a list of revisions of the task definition. Sorted from newest to oldest. Displays the Docker image URI used in the revision.\n\n```shell\nrunecs revisions \\\n  --service my-cluster/my-service \\\n  --last 10\n```\n\n## Limitations\n\n* Only FARGATE launch type is supported.\n* Sidecar containers are not supported\n\n# License\n\nRunECS is distributed under [Apache-2.0 license](https://github.com/meap/runecs/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeap%2Frunecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeap%2Frunecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeap%2Frunecs/lists"}