# Install migration-center on AWS

## AWS Deployment

migration-center supports AWS deployment using **Terraform**.

Following the steps below will result in an AWS deployment containing an **RDS Postgres database** and an **EC2** **instance** with the migration-center **WebClient** and **Jobserver** installed and running, and the **Database component** install files for installing on the Postgres instance with your own migration-center license.

## Prerequisites

1. Obtain your **AWS account ID** and your desired **region** (e.g. eu-central-1) and share it with FME (to <support@migration-center.com>) to get access to the **AMI** for Migration Center.
2. Download the **Terraform archive** (**MC2x.x-AWS-Terraform.zip**) corresponding to your region from the fileexchange platform.
3. Install **Terraform** on your system by downloading the Terraform executable and setting the **PATH** environment variable.\
   See: <https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli>
4. Install **AWS CLI**.\
   See: <https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html>f
5. Log into the the **AWS CLI**:
   * Get your user's **Access key**.\
     **IAM** -> **Users** -> *<**user-name>***-> **Access Keys**\
     (If you don't have one create a new one for **Command Line Interface (CLI)**)
   * Open a **CMD** and log in to your AWS account using the `aws configure` command:
   * Set the default region to your desired one (e.g., eu-central-1).
   * Set the default output format (you can use **json**).

## Create Infrastructure <a href="#create-infrastructure" id="create-infrastructure"></a>

1. Download and unzip the **Migration Center Terraform Archive**.
2. Open a **CMD** and navigate to the directory of the extracted archive.
3. Run **Terraform** commands: `terraform init` and `terraform apply`
4. Set desired values for the requested variables:
   1. **var.ami\_id:** The **ID** of the **AMI** instance received from migration-center support.
   2. **var.create:** If set to **"1"** (true), the RDS Postgres database will be created. If set to **"0"** (false) the database will not be created and database parameters from this script are ignored.
   3. **var.db\_hostname**: The hostname for your **RDS Postgres** database instance. The name must be unique across all DB instances owned by your AWS account in the current AWS Region.\
      **Your DB Hostname can only contain lowercase alphanumeric characters.**
   4. **var.db\_name**: The name for your **RDS Postgres** database.\
      **Your DB Name can only contain lowercase alphanumeric characters.**
   5. **var.deployment\_size**: The size of the deployment. \
      Possible options: **demo**, **small**, **medium**, **large**
   6. **var.ec2\_name**: The name of the **EC2 Instance**.
   7. **var.password**: Password for the **RDS Postgres** database **admin user**. \
      Note that this may show up in logs and it will be stored in the state file.
   8. **var.region**: AWS region where the infrastructure will be created (eg. eu-central-1)
5. Once the command finishes it will display your **rds\_endpoint. Please save this!**

## Connect to the VM <a href="#connect-to-the-vm" id="connect-to-the-vm"></a>

1. Navigate to the EC2 Dashboard: **EC2** -> **Instances**.
2. Select your instance.
3. Click the "**CONNECT**" button on the top bar and choose your desired connection method.

{% hint style="success" %}
Default Username and Password

User: **Administrator**

Password: **O9dz5o?\&WgDCvp?(ur70G5T%nfk5SFGH**
{% endhint %}

{% hint style="warning" %}
For security reasons **please change the default password** after login.
{% endhint %}

### Install the Database <a href="#install-the-database" id="install-the-database"></a>

1. Run the **InstallPostgreDataBase.bat** file found inside the **MC Database Install kit** folder on the desktop.&#x20;
2. When asked to connect to the Postgres database use the following information:
   1. **User**: postgres
   2. **Password**: The **var.password** variable previously set.
   3. **Host**: The value of your **rds\_endpoint** without the port.\
      Example: \
      For rds\_endpoint: [http://test.testid.eu-north-1.rds.amazonaws.com:5432](http://test.testid.eu-north-1.rds.amazonaws.com:5432/)\
      Host: [http://test.testid.eu-north-1.rds.amazonaws.com](http://test.testid.eu-north-1.rds.amazonaws.com:5432/)
   4. **Port**: 5432
   5. **Database Name**: The **var.db\_name** variable previously set.
3. Follow the steps as described in the [Install Guide](https://docs.migration-center.com/install-migration-center#postgresql) for the rest of the installation.

{% hint style="success" %}
The **WebClient** and the **Jobserver** will come preinstalled on your machine.
{% endhint %}

### Verify Installation <a href="#verify-installation" id="verify-installation"></a>

1. Open a web browser.
2. Access the Migration Center Webclient using the URL: <https://localhost/mc-web-client/login>
3. Set up a connection to the database.\
   Select **PostgreSQL** for the type and use the values from steps 3 to 5 from the [Install the Database](#install-the-database) section above.
4. Log in using the **fmemc** user. (default password: **migration123**)
