# AMI

A ProudNet AMI is an <mark style="color:orange;">Amazon Machine Image (AMI)</mark> created on an EC2 instance with default settings.

> Verification for unlimited concurrent licenses per ProudNet device\
> Install the necessary programs to run the server program developed using ProudNet
>
> ***Windows Server AMI***
>
> * Visual C++ 2015\~2019 x64 Redistribution Packages
> * DotNet Core 3.1
> * DotNet 5.0<br>
>
> ***CentOS7 AMI***
>
> * unixODBC-devel
> * openssl-devel
> * wget
> * mono-complete
> * Development Tools ( installed by yum groupinstall )
> * CMake
> * DotNet Core 3.1 SDK ( runtime inclusive )
> * DotNet 5.0 ( runtime inclusive )
> * dotnet-sos ( enables analysis of dump files for dotnet core programs created on Linux. )
> * lldb<br>
>
> ***Linux CentOS7 AMI***
>
> * It is preset to leave a core dump when a crash occurs.<br>

***

## Create an EC2 instance with ProudNet AMI

1. Enter the EC2 service.

<figure><img src="/files/nRogUqZxoWB0X7ak0eMr" alt=""><figcaption></figcaption></figure>

&#x20;

2. On the EC2 page, select the Instance menu.

<figure><img src="/files/pUfiLZmArHepLXH7I0v2" alt=""><figcaption></figcaption></figure>

3. On the Instances page, click the ***Start Instance*** button in the upper-right corner.

<figure><img src="/files/k0HTgocVLWYwy27ofHrM" alt=""><figcaption></figcaption></figure>

&#x20;

4. ***Step 1:*** On the ***Select AMI*** page, select the ***AWS Marketplace*** tab on the left.

<figure><img src="/files/ZbcsvzBRBiThjhX1KcXJ" alt=""><figcaption></figcaption></figure>

5. Type ***ProudNet*** in the search bar.

<figure><img src="/files/zlQO0umuQ5ATJ58uq8II" alt=""><figcaption></figcaption></figure>

6. From the PN1 AMIs found, click the ***Select*** button next to the AMI for your OS.

<figure><img src="/files/cZkTBLZFEWDZTvMFVHpS" alt=""><figcaption></figcaption></figure>

7. A detailed description of the PN1 AMI will appear. Click the Continue button in the bottom right corner, and from there you will be taken through the usual EC2 creation pages (performance selection, key pairs registration, etc.).

<figure><img src="/files/hsVidru9QJB4mNg5Fi1j" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
A security group with a name starting with the string ***ProudNet1*** is automatically created and applied to the EC2 created using the above method. This security group is only allowing inbound ports 9,000-9,100 for TCP & UDP, and outbound for all traffic.\
\
\- **Windows**\
you'll need to add the TCP 3389 port to your inbound rules to use RDP.\
\
\- **Linux**\
if you want to use SSH, you'll need to add the TCP 22 port to your inbound rules, as it could be a security vulnerability if you add it by default.\
\
When specifying the server's listening port and the UDP ports to use for P2P in static assign mode, you can choose from ports in the range 9,000 - 9,100.
{% endhint %}

***

## Windows Server EC2 Instance

<figure><img src="/files/Iw9X22hYfAjgje9JtsCg" alt=""><figcaption></figcaption></figure>

Remotely connect to the created EC2 instance via RDP.\
As shown in the screenshot above, under C:\\, you will find the <mark style="color:orange;">Nettention</mark> folder and the <mark style="color:orange;">ProudNetSetup</mark> installation file.

To use ProudNet Windows AMI for Auto Scaling, etc., please follow the steps below.

> 1. When an EC2 instance is created, metadata & user data are used.
> 2. User data allows you to insert your server executables and the files needed to execute them in the following locations, depending on the language you used to develop them.\
>    \
>    :arrow\_right: **If your server is developed in DotNet or DotNet Core**\
>    put the server executable and the files required to execute in <mark style="color:orange;">C:\Nettention\ProudNet\Sample\bin\netcoreapp3.1</mark>.\
>    \
>    :arrow\_right: **If your server is developed in C++**\
>    put the server executable and the files required to execute in <mark style="color:orange;">C:\Nettention\ProudNet\lib${platform}\dll${Configuration}</mark>. \
>    ( You can also put them in <mark style="color:orange;">C:\Nettention\ProudNet\Sample\bin\Release.C:\Nettention\ProudNet\Sample\bin\Release</mark>.)<br>
> 3. If the server executable file is inserted immediately after launch, the inserted server executable file is executed through user data.

{% hint style="warning" %}
To use ProudNet locally on your development PC, please download the installation file from the [**ProudNet Github**](https://github.com/nettention/proudnet).
{% endhint %}

***

## Linux ( CentOS7 ) EC2 Instance

If you connect to the created CentOS7 instance, you will see a ProudNet folder in the <mark style="color:orange;">root directory( / )</mark>.<br>

To use ProudNet Linux AMI for Auto Scaling, etc., please follow the below steps.

> 1. When an EC2 instance is created, metadata & user data are used.
> 2. User data allows you to insert your server executables and the files needed to execute them in the following locations, depending on the language you used to develop them.\
>    \
>    :arrow\_right: **If your server is developed in DotNet or DotNet Core**\
>    put the server executable and the files required to execute in <mark style="color:orange;">/ProudNet/bin/${Configuration}</mark>.\
>    \&#xNAN;*( Make sure to include all of your Publish output, not just your Build output. If your program is named **project**, you'll need to include not only <mark style="color:orange;">**project**</mark><mark style="color:orange;">.dll</mark>, but also* <mark style="color:orange;">**project**</mark><mark style="color:orange;">.deps.json</mark> *and* <mark style="color:orange;">**project**</mark><mark style="color:orange;">.runtimeconfig.json</mark>*. ) If it is a Release version, it is* <mark style="color:orange;">/ProudNet/bin/Release</mark>*.*\
>    \
>    :arrow\_right: **If your server is developed in C++**\
>    put the server executable and the files required to execute in <mark style="color:orange;">/ProudNet/lib/x86\_x64-linux/${Configuration}</mark>. <br>
> 3. If the server executable file is inserted immediately after launch, the inserted server executable file is executed through user data.

{% hint style="warning" %}
To use ProudNet locally on your development PC, please download the installation file from the [**ProudNet Github**](https://github.com/nettention/proudnet).
{% endhint %}

{% hint style="info" %}
For meta data & user data in EC2, please refer to the AWS manual at the link below.

**Link:** [**AWS docs**](https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)&#x20;
{% endhint %}

***

## Use in CloudFormation

If you are using ProudNet1 AMI for intra-modeling and provisioning with AWS CloudFormation, you can use the templates we provide to create your stack in the following path.

{% hint style="info" %}
For more information about intra-modeling and provisioning using AWS CloudFormation, see the AWS Manual page.

**Link:** [**AWS docs**](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)&#x20;
{% endhint %}

The template we provide contains the <mark style="color:orange;">SecurityGroup</mark> settings for ProudNet.

As shown in the screenshot below, you can view the full text of the provided template by entering the S3 URL when creating the stack and then clicking the ***View in Designer*** button.

<figure><img src="/files/seWd1Z2WOiLm7j38jkna" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.proudnet.com/proudnet.eng/proudnet/1.download/ami.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
