"""Presigned URL.""" import boto3 def create_presigned_url(bucket: str, key: str, expiration: int = 3600) -> str: """Generate a presigned URL to share an S3 object.. Args: bucket (str): The bucket where the S3 object is located in. key (str): The key where the S3 object is located at. Returns: str: The presigned URL. """ return boto3.client("s3").generate_presigned_url( "get_object", Params={"Bucket": bucket, "Key": key}, ExpiresIn=expiration )