GithubHelp home page GithubHelp logo

release-engineering / exodus-lambda Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 10.0 3.26 MB

AWS Lambda functions for Red Hat's Content Delivery Network

License: GNU General Public License v3.0

Python 97.52% Shell 1.96% Dockerfile 0.52%

exodus-lambda's People

Contributors

crungehottman avatar dependabot-preview[bot] avatar dependabot[bot] avatar dichn avatar emanuelelevo avatar github-actions[bot] avatar lmilbaum avatar negillett avatar pre-commit-ci[bot] avatar renovate-bot avatar renovate[bot] avatar rohanpm avatar web-flow avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

exodus-lambda's Issues

Implement script to deploy Lambda@Edge functions

Summary

To deploy a lambda function one must copy the function directory, zip the contents of the directory, deploy the .zip to AWS, and clean up the copied directory.

This process should be automated using a small script in either bash or Python.

Issue Type

  • Feature Request

Current behavior

The steps described must be manually completed.

Desired behavior

A bash or Python script exists to perform the deployment of a function within cdn-lambda/cdn_lambda/functions/ with as few arguments as possible.

Use case

Automate much of the manual work required to deploy a lambda function.

Additional Information

Deployment steps:

Copy desired function directory to working directory
cp -R src-open/cdn-lambda/cdn_lambda/functions/map_to_s3/ .

Enter the directory and zip the contents
cd map_to_s3 && zip deployment.zip *

Create the function in AWS
aws lambda create-function --function-name map_to_s3 --runtime python3.7 --zip-file fileb://deployment.zip --handler map_to_s3.lambda_handler --role arn:aws:iam::XXXXXXX --region DESIRED-AWS-REGION

Or update an existing function
aws lambda update-function-code --function-name map_to_s3_2 --zip-file fileb://deployment.zip --region DESIRED-AWS-REGION

Clean up deployed function directory
cd .. && rm -rf map_to_s3

'/' missing from the uri returned to cloudfront

Summary

The uri in the request passed to CloudfFont should begin with a '/'
https://github.com/release-engineering/cdn-lambda/blob/master/cdn_lambda/functions/map_to_s3.py#L44

Issue Type

  • Bug Report

Steps to reproduce

Attempt to access a valid path that exists in the ddb + object mappings table.

Actual results

ERROR Validation error: Lambda function result validation failed, the specified URI is in an invalid format, uri must start with '/'.

User receives a "502" error from CloudFront after attempting to access cloudfront-domain.cloudfront.net objectkey):

The Lambda function result failed validation: The specified URI is in an invalid format.

Expected results

The uri in the request that is passed to CloudFront begins with '/'. The user is redirected to object key (i.e., attempts to access cloudfront-domain.cloudfront.net/objectkey))

OS / Environment

Lambda@Edge, Python3.7

Additional Information

map_to_s3 function depends on non-existent enviroment variables

Summary

Lambda@Edge functions does not support environment variables, yet map_to_s3 depends on DB_TABLE_NAME and DB_TABLE_REGION. Another method of injecting these variables must be implemented.

Issue Type

  • Bug Report

Steps to reproduce

Attempt to deploy map_to_s3 function with any environment variables.

Actual results

Function creation is rejected by AWS Lambda

Expected results

Function creation is successful and the function can access determine the correct table to query for mapping.

OS / Environment

Lambda@Edge, Python3.7

Additional Information

Disable versioning for CDN s3 buckets

Summary

Versioning for the CDN s3 bucket, configured in exodus-storage.yaml, is unnecessarily enabled.

Issue Type

  • Bug Report

Steps to reproduce

n/a

Actual results

Versioning is enabled for CDN bucket

Expected results

Versioning is disabled for CDN bucket

OS / Environment

n/a

Additional Information

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.