{"id":22403342,"url":"https://github.com/springload/ecs-tool","last_synced_at":"2025-07-31T16:31:57.647Z","repository":{"id":38433645,"uuid":"141345504","full_name":"springload/ecs-tool","owner":"springload","description":"A tool to work with Amazon ECS. Allows easy deployments and running commands.","archived":false,"fork":false,"pushed_at":"2024-09-16T01:55:56.000Z","size":131,"stargazers_count":9,"open_issues_count":5,"forks_count":6,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-09-16T02:48:25.790Z","etag":null,"topics":["aws","deploy-tool","ecs","ecs-cluster","ecs-deploy","hacktoberfest"],"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/springload.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":"2018-07-17T21:29:23.000Z","updated_at":"2024-09-16T01:54:27.000Z","dependencies_parsed_at":"2024-05-10T01:26:01.344Z","dependency_job_id":"5fbb3db3-ea08-4644-9256-ffd7adfa5035","html_url":"https://github.com/springload/ecs-tool","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fecs-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fecs-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fecs-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fecs-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springload","download_url":"https://codeload.github.com/springload/ecs-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228267806,"owners_count":17893841,"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","deploy-tool","ecs","ecs-cluster","ecs-deploy","hacktoberfest"],"created_at":"2024-12-05T09:16:52.536Z","updated_at":"2024-12-05T09:16:53.300Z","avatar_url":"https://github.com/springload.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/springload/ecs-tool)](https://goreportcard.com/report/github.com/springload/ecs-tool)\n\n### What is it?\n\n`ecs-tool` can run commands on an ECS cluster. There are some tools available, like official: [ecs-cli](https://github.com/aws/amazon-ecs-cli), `awscli`, and custom ones like [ecs-deploy](https://github.com/springload/ecs-deploy).\n\nHowever, they have too many flags to just do one thing: run a command.\nAlso, those tools don't give the command output, and there are different flags or even tools to get it.\n\nSo what if there was a project- and environment-specific config with all the settings, so that you can concentrate only on a command you want to run?\n\n### There it is\n\nSo that's it:\n\n```\n$ecs-tool run -h\nRuns the specified command on an ECS cluster, optionally catching its output.\n\nIt can modify the container command.\n\nUsage:\n  ecs-tool run [flags]\n\nFlags:\n      --container_name string   Name of the container to modify parameters for\n  -h, --help                    help for run\n  -l, --log_group string        Name of the log group to get output\n\nGlobal Flags:\n  -c, --cluster string           name of cluster (required)\n      --config string            config file to use. Overrides -e/--environment lookup\n  -e, --environment string       look up config based on the environment flag. It looks for ecs-$environment.toml config in infra folder.\n  -p, --profile string           name of profile to use\n  -t, --task_definition string   name of task definition to use (required)\n```\n\nThere are a couple of required flags, but they can be set either via enviromental variables or in the config.\nIt is possible to define a specific config by using `--config` flag, or rely on `ecs-tool` to look it up based on `--environment` flag.\nThe tool then will search for `infra/ecs-$environment.toml` file.\n\nJust try running `ecs-tool envs` in a project folder to discover available environments.\n\nIt is as simple as this (while being in the project folder `/Users/user/company/project_name`):\n\n```\n$ecs-tool run -e production -- uptime\n2018/07/26 09:52:24  info Using config file: /Users/user/company/project_name/infra/ecs-production.toml\n2018/07/26 09:52:26  info waiting for the task to finish task_definition=project_name-production-app\n 21:52:28 up 16 days, 10:45,  load average: 0.00, 0.02, 0.00\n```\n\nEven more, it is possible to configure `ecs-tool` via environmental variables instead of using config. Every flag has to be uppercased and prefixed by `ECS_`.\nSo that `--cluster` can be set by `ECS_CLUSTER` environmental variable, or `--task_definition` by `ECS_TASK_DEFINITION`.\n\nAlso, `ecs-tool` exit code is the same as the container exit code.\n\n### SSH\n\n'SSH' access availabe to developers using `ecs-tool ssh`\n\n```\n$ecs-tool ssh -e preview\n  INFO[0000] Using config file: ecs-preview.toml\n  INFO[0000] Looking for ECS Task...   task_definition=test-preview-app\n  INFO[0001] Looking for EC2 Instance... task_arn=arn:aws:ecs:ap-southeast-2:123456789:task/00000000-0000-0000-0000-000000 task_definition=test-preview-app\n  INFO[0001] Pushing SSH key...        instance_id=i-12345678888765432 task_definition=test-preview-app\n  INFO[0002] Connecting to container... instance_id=i-12345678888765432 task_definition=test-preview-app\nroot@d00e0c978012:/app# ls\nGemfile  Gemfile.lock  Guardfile  LICENSE  README.md  Rakefile  api_testing_examples.md  app  bin  config  config.ru  db  \ndocker  docker-compose.yml  infra  lib  log  model_testing_examples.md  public  spec  tmp\nroot@d00e0c978012:/app#\n```\n\n### AWS Authentication\n\nIt is handled by [aws-sdk-go](https://aws.amazon.com/sdk-for-go/) and supports all standard methods: env vars, `~/.aws/credential` and `~/.aws/config`.\n\n### Installation\n\nThere are `deb` and `rpm` packages and binaries for those who don't use packages. Just head up to the releases page.\n\nFor Mac users there is one simple command: `brew install springload/tools/ecs-tool`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Fecs-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringload%2Fecs-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Fecs-tool/lists"}