Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dalen/ecs-run
Run a task on AWS ECS and stream output
https://github.com/dalen/ecs-run
Last synced: 2 months ago
JSON representation
Run a task on AWS ECS and stream output
- Host: GitHub
- URL: https://github.com/dalen/ecs-run
- Owner: dalen
- License: mit
- Created: 2018-06-11T12:19:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-26T04:43:04.000Z (5 months ago)
- Last Synced: 2024-10-13T00:25:42.194Z (3 months ago)
- Language: Rust
- Size: 157 KB
- Stars: 14
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.com/dalen/ecs-run.svg?branch=master)](https://travis-ci.com/dalen/ecs-run)
# ecs-run
Run a task on AWS ECS and stream output.
As input this takes an existing cluster and service and runs a task with the same subnets and execution role, but with a different command.
This can for example be used to run a rake task on a Rails service in ECS.## Usage
```
ecs-run 0.2.0
Erik DalénUSAGE:
ecs-run [OPTIONS] ...FLAGS:
-h, --help Prints help information
-V, --version Prints version informationOPTIONS:
-n, --name Name of container to run command in
-E, --env ... Environment variable to pass to container, VAR=valueARGS:
Name of cluster to run in
Service to base task on
... Command to run
```### Using docker
This can be run using Docker in the folloging way:
```
docker run --rm -it -v ~/.aws:/root/.aws:ro -e AWS_PROFILE -e AWS_REGION -e AWS_DEFAULT_REGION edalen/ecs-run
```If you have the credentials set as environment variables you might need to forward them as well, by adding `-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY` etc.
If you run it in CodeBuild you have to pass the `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` to give it access to the IAM role.
## Related work
- [ecs-run-task](https://github.com/buildkite/ecs-run-task) - Similar, but creates a new task definition instead of reusing the one from an existing service.