AWS Environment Set Up

Install AWS CLI

https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

Create a new IAM User & Give CLI Rights

  1. under IAM Users create a new user
  2. Grant Programmatic access
  3. Attach existing policies directly: AdministratorAccess
  4. Note Access Key Id & access Key
  5. In terminal run command below & enter credentials &
    1. region (us-east-1)
    2. default output format: json
#To Grant CLI Rights run in terminal
aws configure
   
 #check
 aws iam list-users

The credentials are stored in ~/.aws/config

Creating Key Pair

  1. Go to Ec2/Network & Security/Key Pairs
  2. Click on Create Key/Pair
  3. Give name, and File format (pem)
  4. On Mac use the following command to set the permissions of your private key file so that only you can read it. If you do not set these permissions, then you cannot connect to your instance using this key pair.
chmod 400 my-key-pair.pem

A pem file will be downloaded: This is the only chance for you to save the private key file. You’ll need to provide the name of your key pair when you launch an instance and the corresponding private key each time you connect to the instance.

SSH into instance

ssh -i "your-key.pem" ec2-user@your-public-ip

Ping Implicit Router

Implicit Router: If your router CIDR is: 10.1.254.0/24, then the implicit router is first ip of the subnet: 10.1.254.10.

#ping implicit router
ping 10.1.254.10
#ping google to verify internet connectivity
ping 8.8.8.8

#to see routes (not the vpc route table but the routes of the instance)
route

if you do ifconfig the eth0 inet addr is the implicit router address : 10.1.254.10