Closed 0xjjoyy closed 2 years ago
Thanks for reaching out. Supporting SSL connections to DB's is in our backlog and we hope to deliver that in a future release. Until then you can get this working manually by doing the following edits to your lambda:
I got this same issue with Postgres Aurora with force_ssl=1. Over a year of no activity/progress on this just makes it hard to recommend AWS SecretsManager.
The recommended solution doesn't work, because the version of FreeTDS included with pymssql 2.1.1 does not support SSL. Pretty weak that two years later this still hasn't been fixed. An no mention of it in the official AWS docs for configuring secrets rotation against an RDS db.
There is already a KB article on this here but it is for custom lambda functions or ones that are not managed by an automation. Can AWS see this and push for a fix? Recommended steps are (from-the-top-of-my-head):
I haven't tried this yet, but I received some support on this issue and here is what is suggested:
The issue is related to the pymssql version (2.1.1) that's being used. This issue is fixed in the version 2.2.0. The following are the steps to rebuild the lambda function that's used for the secret rotation. (Alternatively, the attachments python.zip for the lambda layer and lambda_function.zip could be used) python.zip lambda_function.zip
Create an EC2 machine with Amazon Linux 2 with access to the internet (public).
Make a directory/folder projects & projects/python. You can name the folders accordingly as per your preference.
mkdir projects projects/python
cd projects/python
pip3 install pymssql -t ./
zip -r python.zip .
Create a lambda layer by uploading the above compressed file (python.zip).
Download the current lambda function (lambda_function.zip could be used) and just zip the lambda_function.py (Exclude everything else).
Upload the function (lambda_function.zip).
Add the lambda layer created to the lambda_function.
Agreed on the workaround and thank you for sharing. However, my comment goes to AWS to add some leverage on fixing the lambdas and save us the maintainability issues/work and for all the engines too.
any progress on this?
Hitting the same wall, asking AWS support for ETA on the fix in SAR and will update here
I suppose this announcement resolves this issue?
:)
Though, it doesn't look like the merge to master has happened yet. PR is still out there awaiting final approval.
Yes, SSL/TLS support for rotation has been has been launched and code has been merged in. Please refer to the documentation for setting up rotation and upgrading existing rotation configuration to use SSL connections.
Closing issue.
When requiring TLS connections to a DB instance there is a certificate available to verify the connection.
Asking for the ability to configure the Lambda to specify the regional certificate when creating the rotation Lambda from the serverless repo.
Example of the the parameters used when establishing the connection can be found here.