Skip to content

Commit

Permalink
Ensure kms client is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucy Cunningham committed Apr 15, 2020
1 parent f314d04 commit 181a406
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bless/aws_lambda/bless_lambda_lyft_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ def lambda_lyft_host_handler(
'System entropy was {}, which is lower than the entropy_'
'minimum {}. Using KMS to seed /dev/urandom'.format(
entropy, entropy_minimum_bits))
if not kms_client:
kms_client = boto3.client('kms', region_name=region)
response = kms_client.generate_random(
NumberOfBytes=random_seed_bytes)
random_seed = response['Plaintext']
Expand Down

0 comments on commit 181a406

Please sign in to comment.