A creative and colorful guide to launching EC2 instances and managing AWS IAM policies.
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.
β οΈ 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.
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.
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!
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):
π‘ 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:
Key Pair (Login):
β οΈ 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.
π‘ 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.
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.
π‘ What is IAM? AWS Identity and Access Management (IAM) lets you manage who can access your resources and what they can do with them.
Navigate to the IAM Console.
Create a new policy using the following JSON:
π‘ 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.
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 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.