Intro #
VPC or Virtual Private Cloud is an isolated internal network on AWS environment. When creating Amazon EC2, the default VPC will be created and attached to the instance.
For production, you must create custom VPC and do not use the default.
To access VPC, you can use the AWS console. Or, you can access through the EC2 instance detail, in the Subnet ID
section.
Allow HTTP Access to EC2 Instance #
- Select your EC2 instnace, move to details, click
Subnet ID
. - Select your subnet and click
Route Table
tab (Route Table define rules of your network traffic from your subnet or gateway is directed) - Click your Route Table name to get the details
- Selecy your routable name, and move to the
Route
tab, clickEdit Route
- Click
Add Route
to allow internet to access your instance via gateway- Destination: 0.0.0.0/0
- Target: Internet Gateway
- Choose your internet gateway
- Save changes
Open HTTP in Security Group #
- Move to the EC2 instance menu and select your instance
- Select the
Security
tab and click yourSecurity Group
- Select
Inbound Rules
and clickEdit Inbound Rules
>Add Rule
- Type: HTTP
- Source: Anywhere IPv4
Allow Access to anywhere from EC2 via Security group #
- On the
Security group
of your instance, select theOutbound Rules
- Click
Edit outbound rules
- Type: All traffic
- Destination type: Custom
- Destination: 0.0.0.0/0