리눅스 머신 실행
Launch the EC2 Dashboard
In the AWS Management Console search bar, type EC2
Choose EC2 to open the EC2 Dashboard.
Instances may be launched via a graphical user interface (the console) or with command line scripts. We’ll start with the graphical console interface first, known as the EC2 Dashbord.
Spend a few minutes familiarizing yourself with the layout of the dashboard:
Create a new Key Pair (Optional)
In this section of the lab you will create a Linux instance and login to it to run a few Linux commands. To log in to an instance, you need to be able to connect via SSH. There are several layers of security for accessing instances that are enabled by default by AWS. One of these is with an SSH key pair, which can (very roughly) be thought of as like a unique username and password.
The following steps outline how to create a new SSH key pair that then you will use to log in to a new Linux instance.
-
Sign into the AWS Management Console and open the Amazon EC2 console at https://console.aws.amazon.com/ec2
-
In the upper-right corner of the AWS Management Console, confirm you are in the desired AWS region (e.g., N.Virginia).
- On the Key Pairs page click the Create Key Pair button at the top of the browser window.
- In the resulting pop up window, provide a key pair name of your choosing and select .ppk or .pem depending on which ssh client you will use to connect to the EC2 Instance (For PuTTY select .ppk. For Windows Subsystem Linux, MacOS-X ssh Client, Linux ssh client, Windows ssh client select .pem).
NOTE: For the purpose of this workshop please provide a unique key pair name, so that it might not clash with key pair names provided by other participants using the same AWS account. You could use your name initials in the key pair for easy identification.
- Click add tag. We’ll get into this later, but tagging is an efficient way to track your resources in AWS. We’ll add two tags to this resource- the user (enter your initials) and an imaginary grant (enter a number, but be consistent). Click on Create key pair.
-
The key pair you created should automatically download to your system. Follow any browser instructions to save the file to the default download location. Verify that the file has downloaded and you can locate it. Remember the full path to this .ppk/pem file you just downloaded. This file contains your private key for future SSH connections.
-
You will see a message appear at the top of the screen that says Successfully created key pair. You will see the key pair you created listed.
Launch an EC2 Instance
We will now launch an EC2 Linux based instance.
-
Return to the AWS Management Console and open the Amazon EC2 Dashboard.
-
In the upper-right corner of the AWS Management Console, confirm you are in the desired AWS region (e.g., N. Virginia).
- Click on “Add additional tags” and “Add Tag”. You will find the “Name” you provided for your instance. Now enter the key and value. These keys, more correctly known as a tags, will appear in the console once the instance launches. It makes it easy to keep track of running machines in a complex environment. Create additional tags similar for the ones you used for the key pair previously - give a user and grant key to this machine, and enter the same values. When ready, select Instances, Volumes, Network interfaces under the Resource types.
- Now select the first Amazon Linux 2023 AMI and check 64-bit (x86) under the Architecture drop-down list.
NOTE: The ami-xxxxxxxxx label and specific versions of the installed package may be different than in the image below.
- Under Instance type, click on the drop-down arrow and type c5.2xlarge into the search bar.
Note: This is a somewhat large instance; in general, you should pick these instances based on an analysis of how much RAM and CPU you will need for your job / analysis.
- Under Instance type, click on the drop-down arrow and type c5.2xlarge into the search bar.
Note: This is a somewhat large instance; in general, you should pick these instances based on an analysis of how much RAM and CPU you will need for your job / analysis.
- Select the key pair that you created in the beginning of this lab from the drop-down list under Key pair (login).
앞에서 본인이 만들었던 키페어를 선택합니다!
- Next click on Edit against Network settings. You will be prompted to provide Subnet and Security group details. The security groups will be your firewall rules.
a. Note that the Subnet field can be configured to launch the instance in a specific Availability Zone; while we are keeping the default for this workshop, this gives you control over the location of your machine.
b. Provide a name for your new security group. NOTE: For the purpose of this lab use your “[Your initials]-sec-group”.
c. Confirm an existing SSH rule exists which allows TCP port 22.
d. To accept connections from anywhere, select the drop-down box under the Source type column and select Anywhere which will correspond to 0.0.0.0/0.
아래와 같은 내용입니다. 각자 내용은 조금씩 상이하지만 이번 실습에서 별도로 수정할 것은 없습니다.
본 예제에서는 launch-wizard-1 이라는 이름으로 보안 그룹 (Security Group)이 만들어지게 됩니다.
- Under Configure storage, you have the ability to modify or add storage and disk drives to the instance. For this lab, we will simply accept the storage defaults.
- Review your configuration under Summary and click Launch Instance.
Your instance will now start, which may take a moment. You will be shown the Launch Status page with the message Successfully initiated launch of instance.
- On the lower right of the page click on View all Instances to view the list of EC2 instances. Click on your instance. It will go through an initialization process. Once your instance has launched, you will see your Linux server as well as the Availability Zone the instance is in, and the publicly routable DNS name.
워크샵 스튜디오 환경에서 실습시 생성없이 바로 AWS CLI credential을 사용할 수 있음.