in cloudformation/functions/source/dba-account-creation/app.py [0:0]
def lambda_handler(event, context):
with conn.cursor() as cursor:
cursor.execute("CREATE USER sample_dba IDENTIFIED WITH AWSAuthenticationPlugin as 'RDS';")
print(cursor.fetchone())
cursor.execute("GRANT USAGE ON *.* TO 'sample_dba'@'%' REQUIRE SSL;")
print(cursor.fetchone())
cursor.execute("FLUSH PRIVILEGES;")
print(cursor.fetchone())
return "Created sample_dba database user"