---
title: "Test Machines - Deployment"
weight: 2
---
### STEPS
Aim is to deploy the Test Machines on AWS through terraform.
>**IMPORTANT**: We will first run our Bastion terraform plan and then run terraform plan for application server.
## **Bastion Server**:
Navigate to the Cloud9 terminal and copy **bastion.tf**, **bastion_install.tpl** file from the Resources folder to the Development folder.
```console
cp ./Resources/bastion.tf ./Development/bastion.tf
cp ./Resources/bastion_install.tpl ./Development/bastion_install.tpl
cd ./Development
```
Run the following set of commands.
1. **terraform init**
```console
terraform init
```
This will download & install all the necessary modules.

1. **terraform validate**
```console
terraform validate
```
This will check for any syntax error in the code.

3. **terraform plan**
To understand what the code will reflect and do on your AWS account run
```console
terraform plan --out awslab
```
The resources shown with the '+' symbol are set to be created. It will show the number of additional resources to be added.

4. **terrafrom apply**
If you are satisfied with the plan of the configuration apply it.
```console
terraform apply awslab
```
Open the AWS console to see bastion server in the EC2 Instance.
Bastion:

## **Application Server**:
Navigate to the Cloud9 terminal and copy **apps.tf**, **apache_install.tpl** files from the Resources folder to the Development folder.
```console
cp ./Resources/apps.tf ./Development/apps.tf
cp ./Resources/apache_install.tpl ./Development/apache_install.tpl
cd ./Development
```
Run the following set of commands.
1. **terraform init**
```console
terraform init
```
This will download & install all the necessary modules.

1. **terraform validate**
```console
terraform validate
```
This will check for any syntax error in the code.

3. **terraform plan**
To understand what the code will reflect and do on your AWS account run
```console
terraform plan --out awslab
```
The resources shown with the '+' symbol are set to be created. It will show the number of additional resources to be added.

4. **terrafrom apply**
If you are satisfied with the plan of the configuration apply it.
```console
terraform apply awslab
```

After the deployment go to the AWS Console and check the instance is AWS Console for your application machine(EC2-ubuntu here) and bastion server.

You can further expand the machine to see details specific to it.
Application server:
