S3 Bucket Public Access Block
- Rule: ec2-no-amazon-key-pair
- Assignment: Create an ec2 instance without keypair, see how config marks it as NON_COMPLIANT, fix it by enabling keypair at creation.
Learning Outcome: Access control and public exposure prevention.
✅ Step 1: Launched a Non-Compliant EC2 Instance (No Key Pair)
- Opened the EC2 Console
- Clicked Launch Instance
- Gave the instance a name
- Selected an AMI (Ubuntu)
- Choose an instance type - t2.micro, because it’s a free tier
- Left Key pair (login) as “Proceed without a key pair”
- Configured storage, security group, and launched the instance
- The instance launched successfully — but no SSH access was possible since no key pair was attached
.png)
**Screenshot showing the process of creating the EC2 instance without a keypair**
✅ Step 2: Added the AWS Config Rule – ec2-no-amazon-keypair
- In AWS Config, navigated to Rules > Add Rule
- Searched for ec2-no-amazon-keypair
- Selected the rule and clicked Next
- Left all parameters as default and clicked Add Rule

**Screenshot showing the creation of the ec2-no-amazon-keypair-rule**