4 - ECS Environments

Updated 2 weeks ago by Michael Cretzman

Creating a Harness Environment for ECS is a simple process where you specify the ECS Deployment Type and the ECS cluster where you want to deploy the ECS Task and Service you defined in your Harness Services.

To create the Harness Environment for ECS, do the following:

  1. In your Harness Application, click Environments.
  2. Click Add Environment. The Environment dialog appears.

  3. In the Environment dialog, enter a name, such as Stage, select the Non-Production type (you can add your production environment later), and click SUBMIT. The new Environment appears.

    Next, you define one or more Service Infrastructures for the environment. For ECS, a Service Infrastructure specifies the ECS cluster, launch type, and related VPC information.
  4. Click Add Service Infrastructure. The Service Infrastructure dialog appears.
  5. In Select Cloud Provider, specify the following:
    1. Service - Select the Harness Service to deploy in the Service Infrastructure.
    2. Deployment Type - Select Amazon EC2 Container Services (ECS).
    3. Cloud Provider - Select the AWS Cloud Provider you set up for your ECS deployment.
    4. Click Next. The Configuration section appears.
  6. In Configuration, specify the following:
    1. Provision Type - Select Already Provisioned. If you are using a configured Harness Infrastructure Provisioner, select Dynamically Provisioned and then select the Harness Infrastructure Provisioner you set up and click SUBMIT.
    2. Region - Select the AWS region where your ECS cluster is located.
    3. Cluster Name - Select the ECS cluster where Harness will deploy the Task Definition and Service defined in the Harness Service you selected for this Environment.  
    4. Launch Type - Select Fargate LaunchType or EC2 Instances. The only difference when configuring these launch types is Fargate LaunchType requires that you specify the Target Execution Role.
    5. VPC - Select the VPC where the ECS Cluster is located.
    6. SecurityGroups - Select the AWS security group(s) you want to use when creating instances. When selecting the SecurityGroups, the Group ID for the security groups are listed. You can locate the Group ID in the ECS Dashboard, under Security Groups.
    7. Subnets - Select the VPC subnet(s) where the EC2 instances will be located.
    8. Assign Public IP - Select this checkbox to have external public IP addresses assigned to the deployed container tasks.
  7. Click SUBMIT. The new Service Infrastructure is added to your Environment. You will select this Environment and Service Infrastructure when you create your Harness Workflow.


Now that you have an ECS Service and Environment set up, you can create an ECS Workflow:

How did we do?