# Provisioning AWS EC2 instance

{% hint style="warning" %}
This page, along with the other AWS run guides, are not deprecated in case we need to run `flepiMoP` on AWS again in the future, but also are not maintained as other platforms (such as longleaf and rockfish) are preferred for running production jobs.
{% endhint %}

### Signing in to AWS Management Consol ;

Click on below:

{% embed url="<https://aws.amazon.com/console/?nc1=h_ls>" %}

Sign in as IAM user with your given Accound ID, username and Password

<figure><img src="https://github.com/HopkinsIDD/flepiMoP/blob/documentation-gitbook/documentation/gitbook/jhu-internal/.gitbook/assets/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202022-10-14%2010.07.24.png" alt=""><figcaption><p>Sign in as IAM user</p></figcaption></figure>

Then the next view appears, check "regeon" as "Oregon" by default and "user\@Accond ID" as you expeced.

<figure><img src="https://github.com/HopkinsIDD/flepiMoP/blob/documentation-gitbook/documentation/gitbook/jhu-internal/.gitbook/assets/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202022-10-14%2010.10.02.png" alt=""><figcaption><p>Console Home</p></figcaption></figure>

If you have already accessed AWS console, these kinds of view can be seen. In the case select "EC2" to go to "EC2 Dashboard"(if not, skip it).

### EC2 Dashboard

In this EC2 Dashboard, we can maintain the EC2 boxes from creation to deletion. In this section, how to create an EC2 instance from the AMI image which has already been registered is shown.

<figure><img src="https://github.com/HopkinsIDD/flepiMoP/blob/documentation-gitbook/documentation/gitbook/jhu-internal/.gitbook/assets/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202022-10-14%2010.22.56.png" alt=""><figcaption><p>EC2 Dashboard</p></figcaption></figure>

Select "Images>AMIs" in the right pane(Navigation pain) ;

Select an AMI name which name is "IDD Staging AMI" in the "Amazon Machine Images (AMIs)" by clicking the responding AMI checkbox on the left, then push the "Launch instance from AMI" button (colored in orange).

<figure><img src="https://github.com/HopkinsIDD/flepiMoP/blob/documentation-gitbook/documentation/gitbook/jhu-internal/.gitbook/assets/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202022-10-14%2010.31.32.png" alt=""><figcaption><p>Select an AMI Image among Amazon Machine Images(AMIs)</p></figcaption></figure>

### Launch an instance

To create an EC2 instance, fill out the items as below (example):

* Name and tags
  * input an appropriate name (e.g., *"sample\_box01"*)
* Application and OS image
  * check whether *"AMI from catalog"* is \_"IDD Staging AMI" (for example; select one as you want) ;
* Instance type
  * as you selected by drop-down list(e.g., *m5.xlarge*)
* Key pair(login ;
  * you can generate new key pair if you want to connect to the instance securely (by clicking "Create new key pair" on the right side), but usually select "ams\_\_ks\_ED25519\_\_keypair" by drop-down list so that you can be helped when local client setup (recommended).
    * In case that you use your own key, you will be the only person to log in, of course. you should be careful of handling key management ;
* Network settings (push the button "Edit" on the right to extend configuration; see below)
  * VPC - required
    * select *"HPC VPC"* item by drop-down menu
  * Subnet
    * select "HPC Public Subnet among \_"us-west-2\*" ;
  * Firewall (security groups)
    * select "*Select existing security grous"* toggle, then
    * Common security groups
      * select "dvc\_usa" and "dvc\_\_usa2" by drop-down menu

<figure><img src="https://github.com/HopkinsIDD/flepiMoP/blob/documentation-gitbook/documentation/gitbook/jhu-internal/.gitbook/assets/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202022-10-14%2012.48.08.png" alt=""><figcaption><p>Network settings</p></figcaption></figure>

* Advanced details

  * "EC2S3FullAccess" should be setected in IAM instance profile, but to do it an authentication (IAM role or policy) must be set on to the working IAM account

  <figure><img src="https://github.com/HopkinsIDD/flepiMoP/blob/documentation-gitbook/documentation/gitbook/jhu-internal/.gitbook/assets/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202022-11-23%20%E5%8D%88%E5%89%8D11.58.58.png" alt=""><figcaption><p>Advanced details</p></figcaption></figure>

then push "Launch Instance" button which is located at the bottom right side of the scree ;

<figure><img src="https://github.com/HopkinsIDD/flepiMoP/blob/documentation-gitbook/documentation/gitbook/jhu-internal/.gitbook/assets/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202022-10-14%2012.50.32.png" alt=""><figcaption><p>Launch Instance in Summary</p></figcaption></figure>

<figure><img src="https://github.com/HopkinsIDD/flepiMoP/blob/documentation-gitbook/documentation/gitbook/jhu-internal/.gitbook/assets/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202022-10-14%2012.51.59.png" alt=""><figcaption><p>When in Success</p></figcaption></figure>
