Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion SecretsManagerRDSMySQLRotationMultiUser/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ def get_secret_dict(service_client, arn, stage, token=None):
secret_dict = json.loads(plaintext)

# Run validations against the secret
if 'engine' not in secret_dict or secret_dict['engine'] != 'mysql':
if 'engine' not in secret_dict:
secret_dict['engine'] = 'mysql'
if secret_dict['engine'] != 'mysql':
raise KeyError("Database engine must be set to 'mysql' in order to use this rotation lambda")
for field in required_fields:
if field not in secret_dict:
Expand Down
4 changes: 3 additions & 1 deletion SecretsManagerRDSMySQLRotationSingleUser/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ def get_secret_dict(service_client, arn, stage, token=None):
secret_dict = json.loads(plaintext)

# Run validations against the secret
if 'engine' not in secret_dict or secret_dict['engine'] != 'mysql':
if 'engine' not in secret_dict:
secret_dict['engine'] = 'mysql'
if secret_dict['engine'] != 'mysql':
raise KeyError("Database engine must be set to 'mysql' in order to use this rotation lambda")
for field in required_fields:
if field not in secret_dict:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ def get_secret_dict(service_client, arn, stage, token=None):
secret_dict = json.loads(plaintext)

# Run validations against the secret
if 'engine' not in secret_dict or secret_dict['engine'] != 'postgres':
if 'engine' not in secret_dict:
secret_dict['engine'] = 'postgres'
if secret_dict['engine'] != 'postgres':
raise KeyError("Database engine must be set to 'postgres' in order to use this rotation lambda")
for field in required_fields:
if field not in secret_dict:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ def get_secret_dict(service_client, arn, stage, token=None):
secret_dict = json.loads(plaintext)

# Run validations against the secret
if 'engine' not in secret_dict or secret_dict['engine'] != 'postgres':
if 'engine' not in secret_dict:
secret_dict['engine'] = 'postgres'
if secret_dict['engine'] != 'postgres':
raise KeyError("Database engine must be set to 'postgres' in order to use this rotation lambda")
for field in required_fields:
if field not in secret_dict:
Expand Down