Warning: Problem connecting to site!

EE4 with
ee site create selusin.id --type=wp --ssl=le --cache --dbhost=aws-rds.com --dbuser=dbuser --dbpass=password --dbname=dbname

results in error Problem connecting to site!

Hey there,

Is that your actual ee site create command minus your user/password for the DB?

I’m assuming you’re running EE on an EC2 instance. If so, the endpoint needs to be the one that RDS shows you in your AWS panel (e.g. mysql–instance1.123456789012.us-east-1.rds.amazonaws.com). That DNS name will resolve to a private IP address when accessed from the same EC2 region and VPC.

You’ll need to configure your VPC with public and private subnets, so that your web server can connect to the database privately, but the database can’t be accessed from the public internet. You can find a tutorial for that here: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Tutorials.WebServerDB.CreateVPC.html

As well as allowing access to port 3306, don’t forget to also allow ICMP explicitly. The webserver running EE needs to both ping and connect to the database endpoint for remote MySQL to work without a hitch.