5 - Environments for Traditional Deployments
Environments represent one or more of the deployment infrastructures where you want to deploy your application package files. This section covers adding an Environment that defines the Infrastructure Definition for a file-based Service:
Environments represent one or more of the deployment infrastructures where you want to deploy your application package files. Within an Environment, you add an Infrastructure Definition for each specific deployment infrastructure, using a Cloud Provider and the specific infrastructure details for the deployment, like VPC settings.
For details on creating an Environment, see Environments.
Infrastructure Definitions specify the target deployment infrastructure for your Harness Services, and the specific infrastructure details for the deployment, like VPC settings.
For the example below, we will create an Infrastructure Definition using an AWS Cloud Provider, and we will specify the AWS infrastructure settings for the target AWS VPC and host.
In Scope to specific Services, we select the JAR Service we created earlier.
Later, when we create a Workflow, we will select the JAR Service, and this Infrastructure Definition will be available to use in the Workflow setup.
To add an Infrastructure Definition, do the following:
- In your Harness Application Environment, click Add Infrastructure Definition. The Infrastructure Definition dialog appears.
- In Name, enter the name you will use when you select this Infrastructure Definition in Workflows.
- In Cloud Provider Type, select the type of Cloud Provider that this Infrastructure Definition will use for connections. For example, select Amazon Web Services for AWS EC2 infrastructures.
- In Deployment Type, select the deployment type for the Services that will use this Infrastructure Definition. For example, if you are deploying SSH type Services like JAR, WAR, etc, you would 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 to connect Harness to your deployment infrastructure.
- Fill out the remaining settings. These settings will look different depending on the Cloud Provider you selected. For example, for an AWS Cloud Provider, you will see AWS-specific settings, such as Region and Auto Scaling Group. When you select a region, more settings appear, such as VPC and Tags.
- Provide the settings for your infrastructure. For example, here are the settings for an AWS infrastructure that identify the target host using AWS EC2 Tags.
- In Scope to specific Services, select the Service(s) that you want to use this Infrastructure Definition.
- When you are finished, click SUBMIT. The Infrastructure Definition is added.
Now that you have defined the deployment infrastructure, you can create a Workflow to deploy your Service to it.
When you set up the Infrastructure Definition in Harness to identify the target host(s) where your file will be deployed, you also add Connection Attributes that use a Harness SSH Key secret. This key is used by the Harness Delegate to SSH into the target host.
For more information, see Add SSH Keys.