

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 6
click for more info
Not enough gems
Cost: 6 gems
1: EC2 Instance Configuration: Keys
incomplete
2: EC2 Instances
incomplete
3: AMIs and Instance Types
incomplete
4: Public IPs
incomplete
5: Elastic IPs
incomplete
6: Security Groups
incomplete
7: SSH to Our Server
incomplete
8: Deploy the PatientPing Site
incomplete
9: Open Web Traffic
incomplete
10: Creating and Using Your Own AMI
incomplete
11: Reserved Instances and Savings Plans
incomplete
12: Auto Scaling Groups
incomplete
13: Launch Template
incomplete
14: Launch from Template
incomplete
15: Spot Instances
incomplete
16: Stateful and Stateless Applications
incomplete
17: Optional Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Wait, so anyone who knows my server's public IP address can access it?!
On some level, yes. That's why we need a layer of protection to inspect network traffic coming in and going out, and make sure it's traffic we actually want. We need a firewall, or in AWS terms, a security group. It lets you set rules like:
If you want to access your new EC2 instance from your laptop, you'll need to make sure that traffic is allowed.
Your computer's public IP address is controlled by whoever is providing internet service. You can visit this site to see what your IP is right now, but if you go to a coffee shop or turn on a VPN, your address will change.
Create a security group that allows SSH access (TCP port 22) to the patientping-web server. We need to get on the box before we can do anything useful with it. We'll open up web traffic later.
Cost check: Security groups are free. You only pay for the resources that use them.
Run and submit the CLI tests.
If you want to use the CLI instead, here's the command structure:
# Create a security group
aws ec2 create-security-group --group-name NAME --description DESCRIPTION --vpc-id VPC-ID
# Add an inbound rule
aws ec2 authorize-security-group-ingress --group-id SG-ID --ip-permissions IpProtocol=tcp,FromPort=22,ToPort=22,IpRanges=[{CidrIp=YOUR-IP/32,Description=DESCRIPTION}]
# Attach to an instance
aws ec2 modify-instance-attribute --instance-id INSTANCE-ID --groups SG-ID