NAV Navbar
Switch version:

Create an elastic agent profile for ECS

The elastic agent profile apart from having docker container configurations, provides an ability to configure an EC2 Instance. This would be useful in cases where a docker container cannot be created on the EC2 Instance provisioned using configurations provided in the plugin settings.

Elastic Profile


Note: Configuration marked with (*) are mandatory

Container configuration

Specify the properties for docker container(s) which will be used to spawn ecs elastic agent for GoCD

Container Configuration
  1. Profile ID: Specify a unique id for this profile.

  2. Plugin ID: Select GoCD Elastic Agent Plugin for Amazon ECS from the dropdown.

  3. Docker image*: Docker image to spin up container

  4. Hard memory limit for container*: The maximum amount of memory that container is allowed to use. This field takes a positive integer, followed by a suffix of B, K, M, G and T to indicate bytes, kilobytes, megabytes, gigabytes or terabytes respectively. Read more about memory

  5. Reserved memory for container*: The docker container will start with this amount of memory. This option is only available for Linux platform. This field takes a positive integer, followed by a suffix of B, K, M, G and T to indicate bytes, kilobytes, megabytes, gigabytes or terabytes respectively. Read more about memory.

  6. CPU*: The number of cpu units to reserve for the container. A EC2 instance has 1,024 cpu units for every CPU core. This parameter specifies the minimum amount of CPU to reserve for a container. Read more about CPU.

    • Linux: If set to 0, container will only use unallocated CPU units. Unallocated CPU units are split equally between all containers.
    • Windows: We recommend using at least 1024 CPU units (1 core) for Windows. Allocating lesser CPU units(including 0) will result in very slow running container.
  7. Mount Docker Socket: Mounts the host /var/run/docker.sock to docker container

  8. Privileged: When this parameter is true, the container is given elevated privileges on the host container instance. This is useful to run docker in docker workflow.

  9. Docker Command: Specify the command to run in the container. Enter one parameter per line. This allows you to override the CMD that is specified in the Dockerfile, or provide one in case the Dockerfile does not contain a CMD. Read more about CMD.

  10. Environment Variables: Specify the environment variables. Enter one variable per line. This allows you to override the ENV that is specified in the Dockerfile, or provide new environment variables in case the Dockerfile does not contain any ENV. Read more about ENV.

    • Environment variables are resolved in following order:
      1. Elastic Profile: This will override the variable value specified in plugin settings and Dockerfile.
      2. Plugin Settings: This will override the variable value specified in Dockerfile.
      3. Dockerfile: Variable defined in Dockerfile has low precedence over other two. For example, variable Foo defined in plugin settings or elastic profile will override the variable defined in Dockerfile.

EC2 Instance Configuration

Specify the configuration for the EC2 instance. This is optional. If specified, then the docker container(s) will be spawned on the EC2 instance matching specified configuration. Otherwise, it will be spawned on EC2 instance created using the global configuration specified in Plugin Settings.

EC2 Instance Configuration
  1. AMI ID: This AMI ID will be used to spin up EC2 instances that will run docker containers with this profile. If left unspecified, the default AMI ID configured in the plugin settings will be used to spin up an EC2 instance. Read more about ECS optimized AMIs

  2. Instance type: This instance type will be used to spin up EC2 instances that will run docker containers with this profile. If left unspecified, the default instance type configured in the plugin settings will be used to spin up an EC2 instance. Read more about Instance Type

  3. IAM instance profile: The name of the IAM profile that will allow the ECS agent to make calls to AWS on your behalf. Please refer pre-requisites for more information. If left unspecified, the IAM Instance Profile configured in the plugin settings will be used to spin up an EC2 instance. Read more about IAM Instance Profile

  4. Subnet id(s): Enter comma separated subnet ids. If multiple subnet ids are specified, the subnet having the least number of EC2 instances will be used to spin up a new EC2 instance. If left unspecified, the Subnet id(s) configured in the plugin settings will be used to spin up an EC2 instance. Read more about VPCs & Subnets

  5. Security Group Id(s): Enter comma separated security group ids. EC2 instances will be assigned the security groups(s) specified here. If left unspecified, the Security Group Id(s) configured in the plugin settings will be used to spin up an EC2 instance. Read more about SecurityGroup

  6. Save your changes

Note: Configuration marked with (*) are mandatory