> For the complete documentation index, see [llms.txt](https://iddynamics.gitbook.io/flepimop/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iddynamics.gitbook.io/flepimop/jhu-internal/us-specific-how-to-run/running-with-docker-on-aws/provisioning-aws-ec2-instance.md).

# 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/スクリーンショット%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/スクリーンショット%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/スクリーンショット%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/スクリーンショット%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/スクリーンショット%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/スクリーンショット%202022-11-23%20午前11.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/スクリーンショット%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/スクリーンショット%202022-10-14%2012.51.59.png" alt=""><figcaption><p>When in Success</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://iddynamics.gitbook.io/flepimop/jhu-internal/us-specific-how-to-run/running-with-docker-on-aws/provisioning-aws-ec2-instance.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
