amazon-cloudfront

Reduce size of authorization python AWS Lambda@Edge

Reduce size of authorization python AWS Lambda@Edge Question: I’m trying to implement authorization in my cloudfront distribution. It has worked so far until I ran into size limitation. I’m now running into the cloudfront error message Max allowed: 1048576, which is roughly ~1MB. But after installing the authlib package the total size is around 6MB. …

Total answers: 1

Why do I get a KeyError when testing an S3 triggered Lambda that invalidates files in CloudFront?

Why do I get a KeyError when testing an S3 triggered Lambda that invalidates files in CloudFront? Question: I have a Python 3.7 Lambda function that invalidates CloudFront cache: from __future__ import print_function import boto3 import time def lambda_handler(event, context): print(event) for items in event["Records"]: path = "/" + items["s3"]["object"]["key"] print(path) client = boto3.client(‘cloudfront’) invalidation …

Total answers: 1

GraphQL API Hosted on AWS Lambda Function URL won't load when served over Cloudfront

GraphQL API Hosted on AWS Lambda Function URL won't load when served over Cloudfront Question: I’ve created a GraphQL API available here which is hosted via AWS Lambda using a Function URL. Everything works. I want to host this on a subdomain on my personal website using Cloudfront, like graphql.website.com. I currently host a REST …

Total answers: 1

How to choose an AWS profile when using boto3 to connect to CloudFront

How to choose an AWS profile when using boto3 to connect to CloudFront Question: I am using the Boto 3 python library, and want to connect to AWS CloudFront. I need to specify the correct AWS Profile (AWS Credentials), but looking at the official documentation, I see no way to specify it. I am initializing …

Total answers: 5

Getting started with secure AWS CloudFront streaming with Python

Getting started with secure AWS CloudFront streaming with Python Question: I have created a S3 bucket, uploaded a video, created a streaming distribution in CloudFront. Tested it with a static HTML player and it works. I have created a keypair through the account settings. I have the private key file sitting on my desktop at …

Total answers: 2

Creating Signed URLs for Amazon CloudFront

Creating Signed URLs for Amazon CloudFront Question: Short version: How do I make signed URLs “on-demand” to mimic Nginx’s X-Accel-Redirect behavior (i.e. protecting downloads) with Amazon CloudFront/S3 using Python. I’ve got a Django server up and running with an Nginx front-end. I’ve been getting hammered with requests to it and recently had to install it …

Total answers: 6