Skip to content

Commit

Permalink
Lambda@Edge -> CF2 (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
jplock authored May 8, 2021
1 parent e6b858b commit 62fdfdc
Show file tree
Hide file tree
Showing 19 changed files with 181 additions and 6,956 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

17 changes: 0 additions & 17 deletions .eslintrc

This file was deleted.

54 changes: 0 additions & 54 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [12.x]

steps:
- uses: actions/[email protected]
Expand Down
7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![build status](https://github.com/smoketurner/sam-cdn/workflows/Node%20CI/badge.svg)](https://github.com/smoketurner/sam-cdn/actions?query=workflow%3A%22Node+CI%22)
[![Launch Stack](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/lambda/home?#/create/app?applicationId=arn:aws:serverlessrepo:us-east-1:860114833029:applications/cloudfront-cdn)

[AWS Serverless Application Model](https://aws.amazon.com/serverless/sam/) project that deploys a content delivery network (CDN) using AWS CloudFront for static assets hosted in a private S3 bucket.
A project that deploys a content delivery network (CDN) using AWS CloudFront for static assets hosted in a private S3 bucket.

This project creates the following resources:

Expand All @@ -18,8 +18,8 @@ This project creates the following resources:
- `AWS::S3::Bucket` - private static asset bucket
- `AWS::S3::Bucket` - private bucket to redirect requests to `https://<domain>`
- `AWS::S3::BucketPolicy` - only allow CloudFront to access static asset bucket
- `AWS::Lambda::Function` - Lambda@Edge function for single page applications to redirect requests to `/index.html`
- `AWS::Lambda::Function` - Lambda@Edge function to add various web security HTTP response headers
- `AWS::CloudFront::Function` - CloudFront Function for single page applications to redirect requests to `/index.html`
- `AWS::CloudFront::Function` - CloudFront Function to add various web security HTTP response headers

## Installation

Expand All @@ -29,12 +29,6 @@ cd sam-cdn
npm install
```

## Run Tests

```
npm test
```

## Deploy

```
Expand All @@ -46,5 +40,7 @@ You can upload your static assets into the S3 bucket and Route53 and CloudFront

## References

- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/example-function-add-index.html
- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/example-function-add-security-headers.html
- https://www.awsadvent.com/2018/12/03/vanquishing-cors-with-cloudfront-and-lambdaedge/
- https://medium.com/faun/hardening-the-http-security-headers-with-aws-lambda-edge-and-cloudfront-2e2da1ae4d83
9 changes: 0 additions & 9 deletions __tests__/.eslintrc

This file was deleted.

62 changes: 0 additions & 62 deletions __tests__/handlers/default_index.test.js

This file was deleted.

74 changes: 0 additions & 74 deletions __tests__/handlers/web_security.test.js

This file was deleted.

3 changes: 0 additions & 3 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ phases:
- nodejs: 12
commands:
- npm ci
pre_build:
commands:
- npm test
build:
commands:
- npm run build
Expand Down
7 changes: 0 additions & 7 deletions jest-config.json

This file was deleted.

Loading

0 comments on commit 62fdfdc

Please sign in to comment.