Enabling External Access to AWS Aurora
This guide covers how to enable secure external access to your AWS Aurora clusters from outside AWS using the AWS Management Console.
1. Prerequisites
- AWS Aurora cluster (MySQL or PostgreSQL)
- AWS IAM permissions to access:
- VPC Console
- RDS Console
- EC2 Console (for Security Groups)
2. VPC Configuration
2.1 Configure Internet Gateway
- Navigate to VPC Console → Internet Gateways
- Click Create internet gateway
- Enter a name (e.g.,
aurora-igw
) - Click Create
- Select the new gateway and click Actions → Attach to VPC
- Select your VPC and click Attach
2.2 Configure Route Tables
- Go to VPC Console → Route Tables
- Select the route table associated with your Aurora subnets
- In the Routes tab below, click Edit routes
- Add a new route:
- Destination:
0.0.0.0/0
- Target: Select your Internet Gateway
- Destination:
- Click Save changes
3. Security Group Configuration
3.1 Create Database Security Group
Navigate to EC2 Console → Security Groups
Click Create security group
Enter basic details:
- Security group name:
aurora-external-access
- Description:
Security group for external Aurora access
- VPC: Select your Aurora VPC
- Security group name:
Add inbound rules:
For MySQL:
text
Type: MySQL/Aurora (3306)
Source: Custom
IP: Your specific IP range (e.g., 203.0.113.0/24)
Description: Office network
For PostgreSQL:
text
Type: PostgreSQL (5432)
Source: Custom
IP: Your specific IP range (e.g., 203.0.113.0/24)
Description: Office network
- Click Create security group
3.2 Apply Security Group to Aurora
- Go to RDS Console → Databases
- Select your Aurora cluster
- Click Modify
- Under Connectivity, find Security groups
- Add your new security group
- Click Continue and choose when to apply modifications
4. Database-Specific Configuration
4.1 MySQL User Setup
Connect to your database using a client tool and run:
sql
-- Create user with external access
CREATE USER 'external_user'@'%' IDENTIFIED BY 'strong_password';
-- Grant privileges
GRANT SELECT, INSERT, UPDATE, DELETE ON database_name.* TO 'external_user'@'%';
FLUSH PRIVILEGES;
-- Verify user creation
SELECT user, host FROM mysql.user WHERE user = 'external_user';
4.2 PostgreSQL User Setup
Connect to your database using a client tool and run:
sql
-- Create user
CREATE USER external_user WITH PASSWORD 'strong_password';
-- Grant privileges
GRANT CONNECT ON DATABASE database_name TO external_user;
GRANT USAGE ON SCHEMA public TO external_user;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO external_user;
5. Enable SSL/TLS
5.1 Download Certificate
- Visit Amazon RDS SSL/TLS certificates
- Download the global bundle certificate
- Save as
global-bundle.pem
5.2 Configure SSL in RDS Console
- Go to RDS Console → Databases
- Select your Aurora cluster
- Click Modify
- Under Additional configuration, find SSL/TLS
- Select Force SSL/TLS
- Apply changes
5.3 Connection Examples
MySQL Workbench:
- Create new connection
- Enter host:
<aurora-endpoint>
- Enter user:
external_user
- Under SSL tab:
- Use SSL: Yes
- SSL CA File: Select
global-bundle.pem
pgAdmin:
- Create new server
- Under Connection tab:
- Host:
<aurora-endpoint>
- Username:
external_user
- Host:
- Under SSL tab:
- SSL Mode: Verify-Full
- Root certificate: Select
global-bundle.pem
6. Monitoring Setup
6.1 Enable Enhanced Monitoring
- Go to RDS Console → Databases
- Select your cluster
- Click Modify
- Under Monitoring:
- Enable Enhanced monitoring
- Choose monitoring interval (e.g., 60 seconds)
- Apply changes
6.2 Configure CloudWatch Alarms
- Navigate to CloudWatch Console → Alarms
- Click Create alarm
- Select metrics:
- Database connections
- Failed login attempts
- CPU utilization
- Set appropriate thresholds
- Configure notifications
7. Best Practices
IP Restriction
- Only whitelist necessary IP addresses
- Document all allowed IP ranges
- Review security group rules monthly
User Management
- Create separate users for different applications
- Use strong passwords
- Rotate credentials regularly
SSL/TLS
- Always enforce SSL connections
- Update certificates before expiration
- Test SSL connections after updates
Monitoring
- Review CloudWatch metrics regularly
- Set up alerts for suspicious activities
- Monitor connection counts
8. Troubleshooting
Common issues and solutions:
text
Cannot connect to database:
→ Verify security group allows your IP
→ Check that your IP hasn't changed
→ Confirm SSL certificate is valid
Connection timeout:
→ Verify route table configuration
→ Check network ACLs
→ Confirm security group rules
Access denied:
→ Verify user permissions
→ Check SSL is configured correctly
→ Confirm password is correct