I need to transfer SQL Server RDS' secrets into my Python code that will be ran by Lambda.
What would be best approach to handle such transfer? Sholud it be done with boto3
or/with AWS' Secrets Manager?
Sample Python code:
import pyodbc
def lambda_handler(event,context):
conn = pyodbc.connect('Driver={SQL Server};'
'Server=server_name;'
'Database=db_name;'
'Trusted_Connection=yes;')
cursor = conn.cursor()
cursor.execute('SELECT * FROM db_name.Table')
for row in cursor:
print(row)