Go to VPC Console → Your VPCs → Create VPC
Configure VPC:
daivietblood10.0.0.0/16Configure Subnets:
10.0.1.0/2410.0.2.0/2410.0.3.0/2410.0.4.0/24Configure NAT Gateway:
Configure VPC Endpoints:
Click Create VPC
ℹ️ VPC creation takes 2-3 minutes. Wait until status shows “Available”.
After creation, verify the following resources were created:
| Resource | Name | Details |
|---|---|---|
| VPC | daivietblood-vpc | 10.0.0.0/16 |
| Public Subnet 1 | daivietblood-subnet-public1-ap-southeast-1a | 10.0.1.0/24 |
| Public Subnet 2 | daivietblood-subnet-public2-ap-southeast-1b | 10.0.2.0/24 |
| Private Subnet 1 | daivietblood-subnet-private1-ap-southeast-1a | 10.0.3.0/24 |
| Private Subnet 2 | daivietblood-subnet-private2-ap-southeast-1b | 10.0.4.0/24 |
| Internet Gateway | daivietblood-igw | Attached to VPC |
| NAT Gateway | daivietblood-nat-public1-ap-southeast-1a | In Public Subnet 1 |
| Route Table (Public) | daivietblood-rtb-public | Routes to IGW |
| Route Table (Private) | daivietblood-rtb-private1-ap-southeast-1a | Routes to NAT |
3.1. Security Group for Lambda
Go to VPC Console → Security Groups → Create security group
Configure:
daivietblood-lambda-sgdaivietblood-vpcInbound rules: (Leave empty - Lambda initiates connections)
Outbound rules:
| Type | Protocol | Port | Destination | Description |
|---|---|---|---|---|
| All traffic | All | All | 0.0.0.0/0 | Allow all outbound |
Click Create security group
3.2. Security Group for RDS
Go to VPC Console → Security Groups → Create security group
Configure:
daivietblood-rds-sgdaivietblood-vpcInbound rules:
| Type | Protocol | Port | Source | Description |
|---|---|---|---|---|
| MySQL/Aurora | TCP | 3306 | daivietblood-lambda-sg | Allow Lambda access |
Outbound rules:
| Type | Protocol | Port | Destination | Description |
|---|---|---|---|---|
| All traffic | All | All | 0.0.0.0/0 | Allow all outbound |
Click Create security group
⚠️ Security Best Practice: Only allow access from Lambda Security Group to RDS. Never open port 3306 to 0.0.0.0/0.
Go to RDS Console → Subnet groups → Create DB subnet group
Configure:
daivietblood-db-subnet-groupdaivietblood-vpcAdd subnets:
ap-southeast-1a and ap-southeast-1bClick Create