aws-samples / aws-secrets-manager-rotation-lambdas

Contains Lambda functions to be used for automatic rotation of secrets stored in AWS Secrets Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Positional argument - SecretsManagerRDSMySQLRotationSingleUser

PJ64 opened this issue · comments

commented

Hi, I have had the following error takes 1 positional argument but 2 positional arguments (and 5 keyword-only arguments) were given

I have addressed the issue by adding host as a keyword argument to connection string on line 269.

Function: get_connection
Line: 269
Fix: conn = pymysql.connect(host=secret_dict['host'], user=secret_dict['username'], passwd=secret_dict['password'], port=port, db=dbname, connect_timeout=5)

@PJ64

commented

I am sorry, there is not enough information here to tell what is going wrong. If you are still experiencing this issue please open a support case with AWS.

I can confirm this is an issue. The pymysql library does not accept non-position arguments from v1 onwards