Friday 22 March 2019

Amazon EC2 Instance

How to get started with Amazon EC2
Setting up with Amazon EC2
  • Sign up with AWS
Note -  If you previously signed in to the AWS Management Console using AWS account root user credentials, choose Sign in to a different account. If you previously signed in to the console using IAM credentials, choose Sign-in using root account credentials. Then choose to Create a new AWS account.
To create an AWS account - Open https://aws.amazon.com/ and then choose to create an AWS account.
  • Create an IAM user
To create an IAM user for yourself and add the user to an Administrators group
  1. Use your AWS account email address and password to sign in as the AWS account root user to the IAM console at https://console.aws.amazon.com/iam/.
  2. In the navigation pane of the console, choose Users, and then choose Add user.
  3. For User name, type Administrator
  4. elect the checkbox next to AWS Management Console access, select Custom password, and then type the new user's password in the text box. You can optionally select Require password reset to force the user to create a new password the next time the user signs in.
  5. Choose Next: Permissions.
  6. On the Set permissions page, choose to Add user to group.
  7. Choose Create group.
  8. In the Create group dialog box, for Group name type Administrators.
  9. For Filter policies, select the check box for AWS managed - job function.
  10. In the policy list, select the check box for AdministratorAccess. Then choose Create group.
  11. Back in the list of groups, select the check box for your new group. Choose Refresh if necessary to see the group in the list.
  12. Choose Next: Tags to add metadata to the user by attaching tags as key-value pairs.
  13. Choose Next: Review to see the list of group memberships to be added to the new user. When you are ready to proceed, choose to Create user.
To sign in as this new IAM user 

  • Create a key pair
To create a key pair

  1. Sign in to AWS using the URL that you created in the previous section.
  2. From the AWS dashboard, choose EC2 to open the Amazon EC2 console.
  3. From the navigation bar, select a region for the key pair. You can select any region that's available to you, regardless of your location. However, key pairs are specific to a region; for example, if you see plan to launch an instance in the US East (Ohio) Region, you must create a key pair for the instance in the US East (Ohio) Region.
  4. In the navigation pane, under NETWORK & SECURITY, choose Key Pairs.
  5. Choose Create Key Pair.
  6. Enter a name for the new key pair in the Key pair name field of the Create Key Pairdialog box, and then choose Create. Use a name that is easy for you to remember, such as your IAM user name, followed by -key-pair, plus the region name. For example, me-key-pair-useast2.
  7. If you will use an SSH client on a Mac or Linux computer to connect to your Linux instance, use the following command to set the permissions of your private key file so that only you can read it.
chmod 400 your_user_name-key-pair-region_name.pem
  • Create a Virtual Private Cloud
Amazon VPC enables you to launch AWS resources into a virtual network that you've defined, known as a virtual private cloud (VPC). The newer EC2 instance types require that you launch your instances in a VPC. If you have a default VPC, you can skip this section and move to the next task, Create a Security Group. To determine whether you have a default VPC, open the Amazon EC2 console and look for Default VPC under Account Attributes on the dashboard.
  • Create a Security Group
To create a security group with the least privilege
  1. Choose Security Groups in the navigation pane.
  2. Choose Security Groups in the navigation pane.
  3. Enter a name for the new security group and a description. Use a name that is easy for you to remember, such as your IAM user name, followed by _SG_, plus the region name. For example, me_SG_uswest2.
  4. In the VPC list, select your VPC. If you have a default VPC, it's the one that is marked with an asterisk (*).
  5. On the Inbound tab, create the following rules (choose Add Rule for each new rule), and then choose Create:
    • Choose HTTP from the Type list, and make sure that Source is set to Anywhere (0.0.0.0/0).
    • Choose HTTPS from the Type list, and make sure that Source is set to Anywhere (0.0.0.0/0).
    • Choose SSH from the Type list. In the Source box, choose My IP to automatically populate the field with the public IPv4 address of your local computer. Alternatively, choose Custom and specify the public IPv4 address of your computer or network in CIDR notation. To specify an individual IP address in CIDR notation, add the routing suffix /32, for example, 203.0.113.25/32. If your company allocates addresses from a range, specify the entire range, such as 203.0.113.0/24.
Getting Started with Amazon EC2 Linux Instances

No comments:

Post a Comment