AWS App Runner Service scenarios to Connect to RDS MySQL Database with scenarios 1045
I'm attempting to set up I've hit a wall trying to I'm maintaining legacy code that I've recently deployed a service using AWS App Runner that needs to connect to an RDS MySQL instance. However, I keep working with an authentication failure with the following behavior message: ``` Access denied for user 'myuser'@'%' (using password: YES) ``` I've double-checked the database username and password, and they are correctly set in my environment variables under the App Runner service configuration. The connection string looks like this: ```python DATABASE_URL = "mysql+pymysql://myuser:mysecretpassword@my-rds-endpoint.amazonaws.com:3306/mydatabase" ``` I made sure that my RDS instance is publicly accessible, and the security group allows inbound traffic from App Runner. The inbound rules for the security group are set to allow TCP traffic on port 3306 from the App Runner service's security group. Hereβs a snippet of my security group configuration: ``` Type | Protocol | Port Range | Source -----------|----------|------------|--------------------- MySQL/Aurora| TCP | 3306 | sg-xxxxxxxxxxxx ``` Additionally, I verified that the database user `myuser` has the necessary privileges by running the following SQL command directly on RDS: ```sql GRANT ALL PRIVILEGES ON mydatabase.* TO 'myuser'@'%'; FLUSH PRIVILEGES; ``` Despite all this, the same behavior continues. I also tried running a connection test using a local Python script with the same credentials, and that worked perfectly. It's only failing when deployed on App Runner. I suspect there might be a networking scenario or possibly a misconfiguration in App Runner. Has anyone experienced something similar or have suggestions on what to check next? How would you solve this? Has anyone else encountered this? Any advice would be much appreciated.