4 - ECS Environments
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:
- In your Harness Application, click Environments.
- Click Add Environment. The Environment dialog appears.
- 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.
- Click Add Service Infrastructure. The Service Infrastructure dialog appears.
- In Select Cloud Provider, specify the following:
- Service - Select the Harness Service to deploy in the Service Infrastructure.
- Deployment Type - Select Amazon EC2 Container Services (ECS).
- Cloud Provider - Select the AWS Cloud Provider you set up for your ECS deployment.
- Click Next. The Configuration section appears.
- In Configuration, specify the following:
- 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.
- Region - Select the AWS region where your ECS cluster is located.
- 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.
- 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.
- VPC - Select the VPC where the ECS Cluster is located.
- 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.
- Subnets - Select the VPC subnet(s) where the EC2 instances will be located.
- Assign Public IP - Select this checkbox to have external public IP addresses assigned to the deployed container tasks.
- 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.