AWS Setup Guide

Welcome to this colorful and interactive guide on setting up AWS resources for your projects! πŸš€ Follow along, and you’ll master the basics of VPCs, EC2 instances, and IAM policies.

Set Up Your VPC Basics

⚠️ Important Reminder While this guide focuses on launching EC2 instances, make sure to secure your resources and understand the networking basics when working with VPCs.

Launch EC2 Instances

Step 1: Access the AWS Management Console

Log in to your AWS Management Console and navigate to the EC2 Console.

πŸ’‘ What is EC2? Amazon EC2 (Elastic Compute Cloud) is a legendary AWS service that lets you rent virtual computers in the cloud. Think of it as having your own powerful computer on the internet! EC2 can scale up or down based on your needs.

Step 2: Choose a Region

Switch your AWS region to the one closest to you for better performance and reduced latency.

πŸ“ Your region choice can impact costs and performance. Choose wisely!

Step 3: Launch an EC2 Instance

  1. Name your instance: Use the format nextwork-production-yourname. Replace yourname with your name.

  2. Add tags:

    • Key: Env

    • Value: production

πŸ’‘ Why Tags Matter Tags help organize and manage your AWS resources. For example, you can use tags to filter instances by environment type (e.g., production, development) or allocate costs.

  1. Select an AMI (Amazon Machine Image):

    • Use a Free Tier eligible AMI.

πŸ’‘ What is an AMI? An AMI is a pre-configured template that includes the operating system and applications needed to launch an EC2 instance. Think of it as a ready-to-use system image for your virtual server.

  1. Choose an Instance Type:

    • Select a Free Tier eligible option.
  2. Key Pair (Login):

    • Proceed without a key pair (for this project).

⚠️ Why Key Pairs Matter Skipping the key pair setup means you won’t have SSH access to your instance. This is generally not recommended for long-term projects.

  1. Launch Your Instance: Follow the prompts and launch your instance.

πŸ’‘ Skipped Settings? We skipped network and storage settings for simplicity. These are essential for advanced configurations, such as defining IP addresses or setting up encrypted storage volumes.

Step 4: Launch a Development Instance

Repeat the same steps to create another instance, but:

  • Name: nextwork-development-yourname

  • Tag: Env = development

πŸ’‘ What are Development vs. Production Environments?

  • Development: Used for testing and debugging.

  • Production: Live environment used by end-users.

πŸŽ‰ Congratulations! You’ve launched two EC2 instances with appropriate tags.


Create an IAM Policy

Step 1: Understand IAM

πŸ’‘ What is IAM? AWS Identity and Access Management (IAM) lets you manage who can access your resources and what they can do with them.

Step 2: Create a Policy

  1. Navigate to the IAM Console.

  2. Create a new policy using the following JSON:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "ec2:*",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "ec2:ResourceTag/Env": "development"
        }
      }
    },
    {
      "Effect": "Allow",
      "Action": "ec2:Describe*",
      "Resource": "*"
    },
    {
      "Effect": "Deny",
      "Action": [
        "ec2:DeleteTags",
        "ec2:CreateTags"
      ],
      "Resource": "*"
    }
  ]
}

πŸ’‘ Policy Breakdown

  • Allow: Grants permissions for actions on development tagged resources.

  • Deny: Prevents tag creation or deletion.

  1. Name your policy: NextWorkDevEnvironmentPolicy.

  2. Add a description and create the policy.


Create an AWS Account Alias

  1. Navigate to the IAM dashboard.

  2. Create an account alias: nextwork-alias-yourname.

πŸ’‘ What is an Account Alias? An alias makes your AWS login URL more user-friendly. For example: https://Your_Account_Alias.signin.aws.amazon.com/console/


Create IAM Users and Groups

  1. Create a User Group:

    • Name: NextWorkDevGroup

    • Attach the NextWorkDevEnvironmentPolicy.

  2. Create a User:

    • Username: NextWorkIntern

    • Assign to NextWorkDevGroup.

    • Generate a password for console access.

πŸ“ User groups make it easier to manage permissions for multiple users at once.

πŸŽ‰ You’re Done! You’ve set up EC2 instances and managed access with IAM.