Skip to content

Commit

Permalink
test: 💍 fix KeyError: 'RotationEnabled'
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRDias committed Nov 18, 2023
1 parent daf9c78 commit ad2d6a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def lambda_handler(event, context):

# Make sure the version is staged correctly
metadata = secrets_manager_client.describe_secret(SecretId=arn)
if not metadata["RotationEnabled"]:
if not metadata.get("RotationEnabled"):
logger.error(f"Secret {arn} is not enabled for rotation")
raise ValueError(f"Secret {arn} is not enabled for rotation")
versions = metadata["VersionIdsToStages"]
Expand Down

0 comments on commit ad2d6a3

Please sign in to comment.