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
-
Name your instance: Use the format
nextwork-production-yourname. Replace yourname with your name.
-
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.
-
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.
-
Choose an Instance Type:
- Select a Free Tier eligible option.
-
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.
- 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
-
Navigate to the IAM Console.
-
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.
-
Name your policy:
NextWorkDevEnvironmentPolicy.
-
Add a description and create the policy.
Create an AWS Account Alias
-
Navigate to the IAM dashboard.
-
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
-
Create a User Group:
-
Name:
NextWorkDevGroup
-
Attach the
NextWorkDevEnvironmentPolicy.
-
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.