{"id":15654378,"url":"https://github.com/h3poteto/ecs-task","last_synced_at":"2025-04-15T05:48:54.263Z","repository":{"id":34821954,"uuid":"156800230","full_name":"h3poteto/ecs-task","owner":"h3poteto","description":"Run a task on Amazon ECS and stream the output to stdout","archived":false,"fork":false,"pushed_at":"2025-04-10T21:27:34.000Z","size":223,"stargazers_count":27,"open_issues_count":6,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T05:48:47.444Z","etag":null,"topics":["cloudwatch-logs","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/h3poteto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-11-09T02:42:47.000Z","updated_at":"2025-01-30T14:52:55.000Z","dependencies_parsed_at":"2023-10-03T01:38:05.083Z","dependency_job_id":"2a5a4049-4fda-4474-ae11-4df3a4f8525b","html_url":"https://github.com/h3poteto/ecs-task","commit_stats":{"total_commits":111,"total_committers":7,"mean_commits":"15.857142857142858","dds":0.4504504504504504,"last_synced_commit":"e8a84a8ae21731417690d0d20fcdf81defa71904"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3poteto%2Fecs-task","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3poteto%2Fecs-task/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3poteto%2Fecs-task/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3poteto%2Fecs-task/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h3poteto","download_url":"https://codeload.github.com/h3poteto/ecs-task/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016315,"owners_count":21198832,"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":["cloudwatch-logs","ecs","ecs-task","golang"],"created_at":"2024-10-03T12:51:22.274Z","updated_at":"2025-04-15T05:48:54.238Z","avatar_url":"https://github.com/h3poteto.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/h3poteto/ecs-task/workflows/Build/badge.svg)](https://github.com/h3poteto/ecs-task/actions?query=branch%3Amaster+workflow%3ABuild)\n[![GitHub release](http://img.shields.io/github/release/h3poteto/ecs-task.svg)](https://github.com/h3poteto/ecs-task/releases)\n[![GoDoc](https://pkg.go.dev/badge/github.com/h3poteto/ecs-task/pkg/task)](https://pkg.go.dev/github.com/h3poteto/ecs-task/pkg/task)\n[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)\n\n# ecs-task\n\n`ecs-task` is a command line tool to run a task on the ECS. The feature is\n\n- Wait for completion of the task execution\n- Get logs from CloudWatch Logs and output in stream\n\nThis is a command line tool, but you can use `task` as a package.\nSo when you write own task execition script for AWS ECS, you can embed `task` package in your golang source code and customize task recipe.\nPlease check [godoc](https://pkg.go.dev/github.com/h3poteto/ecs-task/pkg/task).\n\n## Install\nGet binary from GitHub:\n\n```\n$ wget https://github.com/h3poteto/ecs-task/releases/download/v0.2.1/ecs-task_v0.2.1_linux_amd64.zip\n$ unzip ecs-task_v0.2.1_linux_amd64.zip\n$ ./ecs-task help\nRun a task on ECS\n\nUsage:\n  ecs-task [command]\n\nAvailable Commands:\n  help        Help about any command\n  run         Run a task on ECS\n  version     Print the version number\n\nFlags:\n  -h, --help             help for ecs-task\n      --profile string   AWS profile (detault is none, and use environment variables)\n      --region string    AWS region (default is none, and use AWS_DEFAULT_REGION)\n  -v, --verbose          Enable verbose mode\n\nUse \"ecs-task [command] --help\" for more information about a command.\n```\n\n## Usage\nPlease provide a command to `--command`.\n\n```\n$ ./ecs-task run --cluster=base-default-prd --container=task --task-definition=fascia-web-prd-task --command=\"echo 'hoge'\" --region=ap-northeast-1\n[2018-11-10 19:13:15 +0900 JST] hoge\n```\n\nAnd if the command is failed on ECS, `ecs-task` exit with error.\n```\n$ ./ecs-task run --cluster=base-default-prd --container=task --task-definition=fascia-web-prd-task --command=\"hoge\" --region=ap-northeast-1\n[2018-11-10 18:29:24 +0900 JST] ./entrypoint.sh: exec: line 13: hoge: not found\nFATA[0015] exit code: 127\nexit status 1\n$ echo $?\n1\n```\n\nIf you want to run the task as Fargate, please provide fargate flag and your subnet IDs.\n\n```\n$ ./ecs-task run --cluster=base-default-prd --container=task --task-definition=fascia-web-prd-task --command='echo \"hoge\"' --fargate=true --subnets='subnet-12easdb,subnet-34asbdf' --region=ap-northeast-1\n```\n\n## AWS IAM Policy\nBelow is a basic IAM Policy required for ecs-task.\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"AllowUserToECSTask\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"ecs:DescribeTaskDefinition\",\n        \"ecs:RunTask\",\n        \"ecs:DescribeTasks\",\n        \"ecs:ListTasks\",\n        \"logs:DescribeLogStreams\",\n        \"logs:GetLogEvents\",\n        \"iam:PassRole\"\n      ],\n      \"Resource\": \"*\"\n    }\n  ]\n}\n```\n\n## License\nThe package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh3poteto%2Fecs-task","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh3poteto%2Fecs-task","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh3poteto%2Fecs-task/lists"}