binxio / cfn-mysql-user-provider

A CloudFormation custom provider for managing MySQL users
Apache License 2.0
22 stars 18 forks source link

Problem to create user #11

Closed dgutierrezlopez closed 3 years ago

dgutierrezlopez commented 3 years ago

Hello,

I would like to use this fantantic solution, but I could not create the MySQL user. I try with the template demo and it has not worked for me.

Lambda log:

START RequestId: c5004a56-4cdd-45bf-932c-375e687d921b Version: $LATEST

[INFO] 2020-12-10T15:52:52.131Z Found credentials in environment variables. [INFO] 2020-12-10T15:52:52.195Z c5004a56-4cdd-45bf-932c-375e687d921b connecting to database cdlywf1eukm952.cikl3bobkn44.us-east-1.rds.amazonaws.com on port 3306 as user root END RequestId: c5004a56-4cdd-45bf-932c-375e687d921b REPORT RequestId: c5004a56-4cdd-45bf-932c-375e687d921b Duration: 3003.15 ms Billed Duration: 3000 ms Memory Size: 128 MB Max Memory Used: 83 MB Init Duration: 449.17 ms 2020-12-10T15:52:55.195Z c5004a56-4cdd-45bf-932c-375e687d921b Task timed out after 3.00 seconds [INFO] 2020-12-10T15:52:56.513Z Found credentials in environment variables.

Thank you!!!

Regards.

mvanholsteijn commented 3 years ago

This is probably a network timeout. The lambda cannot connect to the mysql database. When you grant the security group of the lambda access to your RDS instance, it should work.

nonai commented 3 years ago

I am also facing this issue. My DB Security Group inbound has allowed TCP port 3306 to the VPC. I am seeing the following in CloudWatch

2020-12-11T16:24:05.455Z f2eb5cfd-fb4f-45d5-bd49-51d7ceead78c Task timed out after 15.02 seconds

Please help.

mvanholsteijn commented 3 years ago

Hi,

it really is a vpc configuration issue. Please check out this CloudFormation template with a complete setup. https://s3.eu-central-1.amazonaws.com/binxio-public-eu-central-1/demo/cfn-mysql-user-provider/complete-stack.yaml

Cheers,

Mark