Skip to main content

Prerequisites

To get the most out of this guide, you will need to:

Overview

This connection uses a wrapper script available in the hoophq/hoopdev image called ecs-exec.sh. This script requires the following permissions to work:
  • ecs:ListTasks
  • ecs:DescribeTasks
  • ecs:ExecuteCommand
It’s important to configure the ECS tasks before trying this feature. Please refer to the AWS documentation first

Connection Configuration

Connection Configuration (Assume Role)

The value system.agent.envs will expose the upstream environment variable from the agent to the connection, allowing the wrapper script to use the IAM task role.

AWS ECS - Interactive Sessions

The AWS Elastic Container Service allows users to connect to tasks and start interactive sessions. These commands can be mapped to Hoop to obtain interactive sessions by allocating a pseudo TTY.
Before attempting to use this feature, it’s essential to configure the ECS tasks. Please refer to the AWS documentation for guidance.

Connection Command

How to Use

Start an interactive session.

AWS ECS - Execute one-off commands

Connection Command

How to Use

Now it’s possible to execute the Ruby script straight from Hoop.dev
The --pipe option necessitates the availability of the base64 command in the image. This command decodes the input content, preventing leakage of shell content such as single or double quotes. This helps address a limitation of the aws ecs execute-command.
It’s possible to pipe any command.
Easily call the scripts.