Amazon Cloud builds a server for free to create your instance

As a developer, I have always hoped to have a server of my own to deploy applications, and I came up with the idea of ​​Alibaba Cloud/Tencent Cloud very early, but the trial time of both is not long. Alibaba is up to 30 days, while Tencent is more It is only 7 days. Because there is no special demand, it has been put aside

I heard before that Amazon Cloud has a one-year free trial, but I was worried that the foreign server might be inconvenient, so I didn’t try it. Recently, in a boring afternoon, I finally decided to try it. After fiddling with two things, it feels quite convenient. Now I put myself on it. Summarize the experience of the pit and share it with you.

Create Free EC2 Instance on AWS

Account Application

The free qualification of Amazon Cloud (AWS) is still very generous. As long as you are a new user, you can get a one-year free trial qualification. So the first step is to apply for an account on AWS, and all you need to prepare is an  email address  and a  credit card  .

AWS cloud service has a Chinese official website, so the operation is relatively convenient, unfortunately, the access speed is relatively slow, we need enough patience. You can directly click on the page to create a free account to enter the registration page, or AWS Console - Signup, just follow the steps step by step. During the registration process, you will be bound to a credit card number, and a pre-authorization of $1 will be deducted . There will be no prompts such as verification codes. However, it is reported that Amazon's reputation is still good, Will not charge you money arbitrarily, and you can complain if you exceed your budget, so if you are worried please stop, or limit your credit card limit to 0~

Because it has been a long time since I applied for an account, I don't remember the specific details, but it will be relatively smooth.

Create an EC2 instance

After applying for an account, you can log in to the console

Create your instance for free on Amazon Cloud Build a server for free on Amazon Cloud and create your instance

The first step into the console is to familiarize yourself with the environment, but we'd better pick a home for the server. Clicking the region where the server is located will display a list of all selectable regions. Generally, the default is Oregon, USA. I chose Asia Pacific Tokyo, mainly because I heard that the delay is relatively low.

OK, ready to create the first server instance in AWS, the process is also very simple, click to start the instance , you will enter the AWS mirror market, note : If you want to try for free, please select the content that contains the free logo throughout the process. Since it is the first instance, choose a simple image.

Create your instance for free on Amazon Cloud Build a server for free on Amazon Cloud and create your instance

This is an image configured with a simple development environment, a Linux system . In the instance type select the eligible free tier labeled

Create your instance for free on Amazon Cloud Build a server for free on Amazon Cloud and create your instance

We use the default configuration and just click the Review and Launch buttons. Then you will see some overviews. In fact, I don't understand very well. Just click to start. AWS will then ask you to configure a key pair, which is your credentials to remotely access the instance, and give it a name like MyPair. Download it and keep your key pair handy. Amazon's tutorial suggests that we put it in the C:\Users\your-users\.ssh folder, which might be a good idea.

Create your instance for free on Amazon Cloud Build a server for free on Amazon Cloud and create your instance

After clicking Start, we go back to the console and enter the Instances tab. You will find that your newly created instance is starting. Don't wait. When the instance status turns green running, your instance is started.

Connect to your instance using ssh

When the instance starts, it will assign you a public IP. If you do not restart the public IP, it will not change. If you want to have a fixed IP, you can read #elastic IP application and binding first. In the AWS introductory tutorial, you will use the git command line to connect to the instance. If you have git installed, you can right-click Git Bash Here at any location.

ssh -i 'private key address\MyPair.pem' ec2-user@{public IP address}

If the connection is successful, you will see the AWS welcome page.

Another option is available on AWS, using PuTTY to connect to a  Linux  instance from Windows. The tutorial is in Chinese, and it is not difficult to understand. The overall process is

  • Install PuTTY
  • Convert the key pair from pem to ppk format supported by PuTTY (using the PuTTYgen tool, which comes with it)
  • Open PuTTY for configuration
  • Configure session-Host Name default port 22, and Connection-SSH-Auth specify ppk file location
  • Go back to the session page, name the Saved Session, and save it for the next visit. You can then connect by double-clicking
  • Click Open to open the session and enter the command line interface where the Host Name format is ec2-user@{public IP address}, ec2-user is the default username of the Amazon Linux AMI, not your username.

You can install WinSCP in exchange with the example file. If you have saved a session in PuTTY, you can import it directly without reconfiguring when you open WinSCP.

There are detailed tutorials in the link just provided, if you don't understand, you can study it well

Elastic IP Application and Binding

We know that the public IP is actually the home of your server on the Internet. If your home is always moving, friends will not be able to find you. AWS will assign a public IP to each instance, but it is not fixed. If we want to fix an IP, we need to apply for an elastic IP.

Applying for an elastic IP is very, very simple, just enter the elastic IP tab - assign a new address - assign.

Create your instance for free on Amazon Cloud Build a server for free on Amazon Cloud and create your instance

Action Note that  AWS's flexible IP allocation policy is very interesting. Applying for an IP is free, but idle is charged. The IP you apply must be bound to a running instance , otherwise it will be charged at 0.05USD per hour. I was charged 0.5USD for shutting down an instance overnight.

So, assign the IP you applied for quickly, operate - associate address - select associated instance - associate it. If there are redundant IPs, they can be released through the operation - release the address.

Security Group Policy

Each instance will have a security group policy to control the open state of the port. By default, only port 22 of SSH is open. We can configure security group policies according to our own needs.

Create your instance for free on Amazon Cloud Build a server for free on Amazon Cloud and create your instance

You can enter the security group policy through the best column of the instance status bar. For example, if I want to build a Web website, then I need to open port 80 and port 443 in the inbound policy. Similarly, if you build a website but cannot access it on the external network, it may be that your Http port is not open.

Free limit

The AWS free limit is still relatively generous, with 750 hours of instance running time per month, which means that if you only open one instance , it will not exceed the limit if you run it 24 hours a day. There is 15G outbound traffic every month, and the general traffic will be more pitted. Everyone should use it and cherish it. Others can be found in the AWS Free Usage Tier FAQ.

The second is the elastic IP problem mentioned just now. If you are worried, you can not apply for an elastic IP, and ensure that the instance will not be switched off until the instance is shut down.

The original text comes from: https://www.linuxprobe.com/aws-esc-free.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324777241&siteId=291194637