Implemented AWS IAM policies to enforce least privilege access between development and production EC2 environments using resource tags.
AWS Cloud Security with IAM
This project demonstrates how AWS IAM can be used to control access to cloud resources using least privilege principles. I created 2 separate production and development EC2 environments and restricted user access using IAM policies with resource based conditions.
β’ AWS Identity and Access Management (IAM)
β’ Amazon EC2
β’ IAM Policies (JSON)
β’ IAM Users & User Groups
β’ Resource Tagging
β’ Separate production and development environments
β’ Restrict intern access to development resources only
β’ Prevent accidental changes to production infrastructure
β’ Practice real-world cloud security controls
β’ Two EC2 instances:
β’ Production EC2 (Env = production)
β’ Development EC2 (Env = development)
β’ Custom IAM policy using tag based conditions
β’ IAM user group for interns
β’ IAM user assigned to intern group
β’ AWS account alias for simplified login

{
"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": "*"
}
]
}
β’ Logged in as IAM intern user
β’ Attempted to stop production EC2 instance β β Access denied
β’ Successfully stopped development EC2 instance β β Allowed
β’ Verified IAM permissions worked as intended

β’ Least privilege access
β’ Environment isolation (dev vs prod)
β’ Tag-based access control
β’ IAM user & group management
β’ Policy testing and validation