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.
In this topic:
Before You Begin
Step: Set Up Environment
To set up the Environment, do the following:
- In your Harness Application, click Environments, and then click Add Environment. The Environment settings appear.
- In Name, enter a name for the Environment that identifies it to your colleagues. In this example, File-Based is used as the name for the Environment.
- In Environment Type, select Production or Non-Production, and click Submit. The new Environment is added.
Next, we will add an Infrastructure Definition to provide the Deploy Workflow with the target deployment environment.
Step: Set Up Infrastructure Definition
Infrastructure Definitions specify the target deployment infrastructure for your Harness Services, and the specific infrastructure details for the deployment, like VPC settings. For Artifact Build and Deploy Pipelines, you will scope the Infrastructure Definition to the Service you added earlier where you identified the Artifact Source for your artifact. You will also use the Cloud Provider you set up in Harness Account Setup to configure the Infrastructure Definition. Then you will specify the target infrastructure for the deployment. In this example, an AWS EC2 instance is used.
To set up the Infrastructure Definition, do the following:
- In Environment, click Add Infrastructure Definition. The Infrastructure Definition settings appear.
- In Display Name, enter a name for the Infrastructure Definition. In this example, ToDo List WAR is used as a name for the Infrastructure Definition.
- In Cloud Provider Type, select the type of Cloud Provider you used in Harness Account Setup.
- In Deployment Type, select Secure Shell (SSH).
- Click Use Already Provisioned Infrastructure. If you were using a Harness Infrastructure Provisioner, you would select Map Dynamically Provisioned Infrastructure.
- In Cloud Provider, select the Cloud Provider you set up in Harness Account Setup.
- Fill out the remaining infrastructure settings for your target deployment infrastructure.
- In Scope to specific Services, select the Service you created in Service and Artifact Source.
Here is an example that targets an AWS EC2 instance. 9. Click Submit.
The Infrastructure Definition is added. You will select this Infrastructure Definition when you create the Deploy Workflow.