Rails Console ECS
Execute ruby scripts inside a running container (Tasks) in a ECS Cluster, this is a auxiliary type to allow executing full fledged scripts inside a rails console in ECS.
Type: rails-console-ecs
Configuration
Name | Required | Description |
---|---|---|
ECS_CLUSTER | yes | The name of the ECS Cluster. |
ECS_SERVICE_NAME | yes | The name of the ECS service. |
ECS_CONTAINER | yes | The name of the running container of the ECS Task. |
ECS_AWS_ACCESS_KEY_ID | yes | ECS AWS Access Key ID. |
ECS_AWS_SECRET_ACCESS_KEY | yes | ECS AWS Secret Access Key. |
ECS_AWS_REGION | yes | ECS AWS Region. |
info
The ECS task id is obtained dynamically listing it by its service name
In order for this to work the ECS need to be configured properly, check this additional information:
- Enabling and using ECS Exec
- A tool to validate if the setup is working properly
Examples
Run a ruby script inside an ECS container
runops tasks create --target rails-console-ecs-type -s 'puts "Hello World From ECS"'
Limitations
- Executing an invalid ECS task will not result in an Runops Task error.