GoCD - Amazon ECS Elastic Agent Plugin
Note: The Amazon ECS Elastic Agent Plugin version 4.0.0 requires GoCD server version 18.2.0 or higher. The plugin will not work with the older version of GoCD server.
This Elastic Agent Plugin for Amazon EC2 Container Service allows you to run elastic agents on Amazon ECS (Docker container service on AWS). The plugin takes care of spinning up and shutting down EC2 instances based on the need of your deployment pipeline, thus removing bottlenecks and reducing the cost of your agent infrastructure.
When a pipeline is triggered, GoCD sees that the jobs in the pipeline have been configured to use ECS agents, and passes on information about the configured elastic agent profiles to the plugin. The plugin, based on the user-defined configuration, decides how many EC2 instances to bring up or reuse and how many ECS elastic agents to bring up within those EC2 instances.
The settings allow you to choose the AMI to be used for the EC2 instance, the instance type, security groups, the Docker image for the ECS container and memory limits among other settings. Since the Docker image is specified as a part of the profile, provisioning software for a build, test or deploy agent becomes much easier.
Once the builds finish and the EC2 instances are idle for a while, they will be automatically scaled down and destroyed, removing the cost of running idle EC2 instances. Along with saving cost, this enables a flexible and dynamic build grid in which you don’t need to worry about configuration drift.
The set of images below explain this concept as well: