4 - Environment
Environments represent one or more of your deployment infrastructures, such as Dev, QA, Stage, Production, etc. For Artifact Build and Deploy Pipelines, the Environment specifies the Service containing the new artifact for the Deploy Workflow to use and the target deployment infrastructure where the new build will be deployed.
To set up the Environment, do the following:
- In your Harness Application, click Environments, and then click Add Environment. The Environment dialog appears.
- In Name, enter a name for the Environment that identifies it to your colleagues. In our example, we use File-Based.
- In Environment Type, select Production or Non-Production, and click SUBMIT. The new Environment is added.
Next, we will add a Service Infrastructure to provide the Deploy Workflow with the target deployment environment.
Service Infrastructures specify a deployment infrastructure using a Service, a Cloud Provider, and the specific infrastructure details for the deployment, like VPC settings.
For Artifact Build and Deploy Pipelines, you will specify the Service you added earlier where you identified the Artifact Source for your artifact, and the Cloud Provider you set up in Harness Account Setup. Then you will specify the target infrastructure for the deployment. In our example, we use an AWS EC2 instance.
To set up the Service Infrastructure, do the following:
- In the Environment, click Add Service Infrastructure. The Service Infrastructure dialog appears.
- In Display Name, enter a name for the Service Infrastructure. In our example, we use ToDo List WAR.
- In Service, select the Service you created in Service and Artifact Source.
- In Cloud Provider, select the Cloud Provider you set up in Harness Account Setup.
- Click Next.
- In Provision Type, select Already Provisioned. If you want to use a Harness Infrastructure Provisioner, select Dynamically Provisioned.
- Fill out the remaining infrastructure settings for your target deployment infrastructure. Here is an example that targets an AWS EC2 instance:
- Click SUBMIT. The Service Infrastructure is added. You will select this Service Infrastructure when you create the Deploy Workflow.