{"id":18942337,"url":"https://github.com/bugcrowd/ecs-task-runner","last_synced_at":"2025-04-15T03:51:03.490Z","repository":{"id":12664126,"uuid":"71512688","full_name":"bugcrowd/ecs-task-runner","owner":"bugcrowd","description":"Run a Docker task on AWS ECS and stream logs back via AWS Cloudwatch Logs","archived":false,"fork":false,"pushed_at":"2025-03-02T22:22:00.000Z","size":879,"stargazers_count":12,"open_issues_count":6,"forks_count":8,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-08T16:54:30.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bugcrowd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-10-20T23:32:35.000Z","updated_at":"2024-12-01T22:26:02.000Z","dependencies_parsed_at":"2024-01-29T00:32:41.174Z","dependency_job_id":"f0fa2af7-0bc9-42cf-89d2-3e3f5d1af15b","html_url":"https://github.com/bugcrowd/ecs-task-runner","commit_stats":{"total_commits":62,"total_committers":6,"mean_commits":"10.333333333333334","dds":0.6935483870967742,"last_synced_commit":"25f12ef62e37dd5d8f6ef81af435ec59594e1c70"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugcrowd%2Fecs-task-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugcrowd%2Fecs-task-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugcrowd%2Fecs-task-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugcrowd%2Fecs-task-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugcrowd","download_url":"https://codeload.github.com/bugcrowd/ecs-task-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248594191,"owners_count":21130316,"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":[],"created_at":"2024-11-08T12:32:28.019Z","updated_at":"2025-04-15T03:51:03.465Z","avatar_url":"https://github.com/bugcrowd.png","language":"JavaScript","readme":"ECS Task Runner\n===============\n\nRun a task on ECS and receive output by sending task logs to Cloudwatch Logs and streaming them back to you.\n\nInstallation\n------------\n\n**NOTE:** We have moved the package under our `bugcrowd` NPM organization - this will be the only package location maintained going forward.\n\n- For cli usage: `npm install -g @bugcrowd/ecs-task-runner`\n- As a module: `npm install @bugcrowd/ecs-task-runner --save`\n\nUsage\n-----\n\nECS Task Runner requires an already existing ECS cluster and Task Definition. The Task Definition must send it's logs to AWS Cloudwatch (using awslogs-stream-prefix) and the ECS hosts will need an IAM role that has permission to do that.\n\n### CLI Tool\n\n```\nOptions:\n  --cluster                                                           [required]\n  --task-definition                                                   [required]\n  --container-name                                                    [required]\n  --cmd                                                               [required]\n  --started-by\n  --env\n  --launch-type\n  --assign-public-ip\n  --subnets\n  --security-groups\n  --region                                                  (default: us-east-1)\n```\n\n#### cluster\nThe arn of your ECS Cluster\n\n#### task-definition\nThe arn of your ECS Task Definition\n\n#### container-name\nThe name of your container in your Task Definition that you want to run this command in\n\n#### cmd\nThe command you want to run\n\n#### started-by\nIf provided, this will show up as startedBy in your ECS console\n\n#### env\nThis option is a key/value pair defined as `key=value` and can be repeated multiple times. Each\npair is passed as an environment variable to the container, where `key` is the name of the env var\nand `value` is it's value.\n\n#### launch-type\nSpecify the launchType for the task to be run. Valid options are EC2, FARGATE and EXTERNAL.\nDefault: EC2\n\n### Network configuration\nWhen awsvpc networking mode is configured for the task this requires the awsvpc configuration to\nbe specified when executing a taks. The following options can be used to do so. Subnets and security groups\nare required options in this case.\n\n#### assign-public-ip\nBoolean whether to assign a public ip to the task.\n\n#### subnets\nArray of subnets to configure.\n\n#### security-groups\nArray of security-groups.\n\n#### region\nThe AWS region used when accessing ECS and CloudWatch. If nothing is provided falls back to `us-east-1`.\nThe `AWS_DEFAULT_REGION` environment variable has precendence over this setting.\n\n### Example Module Usage\n\n```\nconst ecsTaskRunner = require('ecs-task-runner');\n\nconst options = {\n  clusterArn: 'xxx',\n  taskDefinitionArn: 'xxx',\n  containerName: 'xxx',\n  cmd: 'echo hello'\n};\n\necsTaskRunner(options, function(err, stream) {\n  if (err) throw err;\n\n  stream.pipe(process.stdout);\n\n  stream.on('error', (err) =\u003e {\n    throw err;\n  });\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugcrowd%2Fecs-task-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugcrowd%2Fecs-task-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugcrowd%2Fecs-task-runner/lists"}