{"id":24388136,"url":"https://github.com/masterpointio/ecsrun","last_synced_at":"2025-04-11T05:41:05.527Z","repository":{"id":41985065,"uuid":"254919310","full_name":"masterpointio/ecsrun","owner":"masterpointio","description":"Easily run one-off tasks against an ECS Task Definition","archived":false,"fork":false,"pushed_at":"2022-04-20T15:12:48.000Z","size":142,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-02T20:53:44.585Z","etag":null,"topics":["aws","aws-sdk-go","cli","ecs","ecs-task","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masterpointio.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}},"created_at":"2020-04-11T17:27:09.000Z","updated_at":"2024-12-30T00:50:09.000Z","dependencies_parsed_at":"2022-08-12T01:21:07.933Z","dependency_job_id":null,"html_url":"https://github.com/masterpointio/ecsrun","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masterpointio%2Fecsrun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masterpointio%2Fecsrun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masterpointio%2Fecsrun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masterpointio%2Fecsrun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masterpointio","download_url":"https://codeload.github.com/masterpointio/ecsrun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248350982,"owners_count":21089268,"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","aws-sdk-go","cli","ecs","ecs-task","golang"],"created_at":"2025-01-19T13:56:28.779Z","updated_at":"2025-04-11T05:41:05.499Z","avatar_url":"https://github.com/masterpointio.png","language":"Go","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# ecsrun\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/masterpointio/ecsrun)](https://goreportcard.com/report/github.com/masterpointio/ecsrun)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/masterpointio/ecsrun/Go%20Build%20%26%20Test)](https://github.com/masterpointio/ecsrun/actions?query=workflow%3A%22Go+Build+%26+Test%22)\n[![Powered By: GoReleaser](https://img.shields.io/badge/powered%20by-goreleaser-green.svg?style=flat-square)](https://github.com/goreleaser)\n[![Release](https://img.shields.io/github/release/masterpointio/ecsrun.svg)](https://github.com/masterpointio/ecsrun/releases/latest)\n\nEasily run one-off tasks against an ECS Task Definition 🐳\n\n## Purpose\n\n`ecsrun` is a small go CLI app to provide a config file based approach to executing one-off ECS Tasks. The ECS `RunTask` command is a pain to write out on the command line, so this tool provides an easy way to wrap any common `RunTask` executions you do in a simple yaml file.\n\n## Install\n\n#### From Homebrew\n\n```\nbrew install masterpointio/tap/ecsrun\n```\n\n#### From Go Get\n\n```\ngo get -u github.com/masterpointio/ecsrun\n```\n\n## Usage\n\n#### Invoking with `ecsrun.yaml` (easiest)\n\nGiven you have an `ecsrun.yaml` like so:\n\n```yaml\ndefault: \u0026default\n  cluster: mp-test-cluster\n  task: mp-test-alpine\n  security-group: sg-06c65c3206401917e\n  subnet: subnet-0c97e16b8a52b4b86\n  public: false\n  cmd:\n    - bash\n    - -c\n    - echo\n    - \"hello world\"\n\nmigrate:\n  \u003c\u003c: *default\n  task: mp-test-django\n  cmd:\n    - python\n    - ./manage.py\n    - migrate\n```\n\nYou can invoke two easy commands to spin up a one-off task:\n\n```bash\n# Invoke the 'mp-test-alpine' task definition with the 'hello world' `CMD`\necsrun\n\n# Invoke the 'mp-test-django' task definition with the `manage.py migrate` `CMD`\necsrun --config migrate\n```\n\n#### From Command Line\n\n`ecsrun` supports all of the config options via CLI arguments as well:\n\n```bash\necsrun --cluster mp-example-task-runner \\\n       --subnet subnet-0c97e16b8a52b4b86 \\\n       --security-group sg-06c65c3206401917e \\\n       --cmd \"bash,-c,echo,\\\"Hello world\\\"\" \\\n       --region us-west-2 \\\n       --public \\\n       --verbose\n```\n\nYou can use this in combination with a configuration file to only override certain arguments:\n\n```bash\necsrun --config migrate\n       --subnet ${DIFFERENT_SUBNET} \\\n       --public\n```\n\n#### From Environment Variables\n\nYou can also pass configuration to `ecsrun` via environment variables:\n\n```bash\nexport AWS_PROFILE=\"mp-gowiem\"\nexport AWS_ACCESS_KEY_ID=\"123\"\nexport AWS_SECRET_ACCESS_KEY=\"SECRET123\"\nexport ECSRUN_CMD=\"bash,-c,echo,\\\"Hello world\\\"\"\nexport ECSRUN_CLUSTER=\"mp-testing-cluster\"\nexport ECSRUN_TASK=\"mp-testing-task\"\nexport ECSRUN_SECURITY_GROUP=\"sg-06c65c3206401917e\"\nexport ECSRUN_SUBNET=\"subnet-0c97e16b8a52b4b86\"\nexport ECSRUN_VERBOSE=\"true\"\n\n# Invoke a dry run to check the resulting `RunTaskInput` configuration\necsrun --dry-run\n```\n\n#### Initialize an empty `ecsrun.yaml`\n\nDon't have an `ecsrun.yaml` file yet? Initialize the scaffold of one in your current directory:\n\n```\necsrun init\n```\n\n#### More\n\nBe sure to check out `ecsrun help` for more info and full configuration options.\n\n## Inspiration\n\nI wrote the included `run_command` bash script for a client project as admin tasks were quite common on the project (migrations, django `manage.py` jobs, debugging, etc). This script was pretty ugly (what bash script isn't honestly), but it got the job done. I wanted to build a new project in golang to try out the langauge, and converting `run_command` to something with a bit more grace seemed like a fun project. `ecsrun` is the result!\n\n## Roadmap\n\n- [x] Support basic CLI usage\n- [x] Support local config file\n- [x] Support `--dryrun` Flag\n- [x] Add more tests\n- [x] Add a `ecsrun init` command to generate the ecsrun.yml config file.\n- [ ] Support log group / stream tailing of initiated task\n- [ ] Support selection of resources similar to gossm (cluster, task def, task def revision, etc etc)\n- [ ] Support validation of given params: cluster, definition name, revision, subnet ID, SG ID, ect.\n- [ ] Support EC2 usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasterpointio%2Fecsrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasterpointio%2Fecsrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasterpointio%2Fecsrun/lists"}