Skip to content

Commit

Permalink
feat: upload using cloudfront sign
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHai committed Sep 4, 2024
1 parent eb0c21e commit 0b25408
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server/utils/get_private_key.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import boto3
from botocore.exceptions import ClientError

def get_private_key(region_name: str, secret_id: str):
session = boto3.session.Session()
client = session.client(service_name="secretsmanager", region_name=region_name)
try:
get_secret_value_response = client.get_secret_value(SecretId=secret_id)
except ClientError as e:
# For a list of exceptions thrown, see
# https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html
raise e

return get_secret_value_response["SecretString"]

0 comments on commit 0b25408

Please sign in to comment.