The Amazon EC2 service provides us with server instances. These can be dedicated/real/physical/bare metal servers or virtual machines running on top of a hypervisor.
EC2 stands for "Elastic Compute Cloud".
It is possible to set up and start an EC2 instance in a matter of minutes, making it ideal for scaling purposes (we would need to set up a load balancer as well).
EC2 instances come with an operating system installed by default. The operating system that runs on the server can be chosen using the AWS console.
Windows is available and so are multiple Linux distributions.
Amazon provides their own Linux distro: AMI Linux. Generally it works quite well and it had everything we needed in the past available through the package manager. Besides AMI Linux, CentOS is also available and might be a slightly better choice, when it is required to install software that is not available through the package manager. The reason is that the CentOS community is much bigger, AMI Linux is only used in the Amazon cloud, while CentOS is running on servers everywhere.
Both distros use "yum" as package manager at the time of writing, but it is likely to be replaced with "dnf" in the future.
When an EC2 instance is started it is automatically placed in a VPC, allowing for communications on a private network between servers. So if the server should also be publicly accessable (through the internet), it will have 2 ip addresses by default. A private ip for internal communication on the VPC and a public ip for communication over the internet.
When the server is restarted the public ip address is released and a new public ip address is assigned!
To prevent that from happening it is possible to assign a "elastic ip": https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
Amazon AWS operates from multiple regions around the world. The instance should generally be located as close to the customer as possible (unless requested otherwise).
That means that for customers inside Vietnam or customers that have Vietnam as a target market, you should start the instance in the "Asia/Pacific (Singapore)" region. For customers that want to operate in Japan it is better to start the instance in region "Asia/Pacific (Tokyo)". If the customer is from a different country or wants to operate in a different location, please use your map reading skills to select the right region.
By default when you start an EC2 instance it is placed in something called a "Security Group". The security group basically works like a firewall. It can block incoming and outgoing tcp and udp traffic based on its ports.
So to be able to access the instance over the internet, the security group needs to allow network traffic on the port that is required. More information on how to manage the security groups and their rules can be found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html
There are lots of options that have an influence on the price of the service. To name a few:
The easiest way to find out the price is to use the price calculator: https://calculator.s3.amazonaws.com/index.html
It allows you to select all the services you need and to change the options and updates the monthly fee accordingly.
Generally we pick the "on demand" plans, that way there do not need to be any fees paid up front and the instance (and billing) can be stopped at any time.
Just setting up a basic instance is very easy. However when things such as automatic scaling or high availability are required it can become more complicated.
For the basics, please study this guide: https://aws.amazon.com/ec2/getting-started/
For more advanced topics, please check the official documentation: https://aws.amazon.com/documentation/ec2/.