Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neilkuan/aws-us-cdk-cloudfront-demo
https://github.com/neilkuan/aws-us-cdk-cloudfront-demo
aws-cdk aws-cdk-constructs aws-cloudfront lambda-edge
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/neilkuan/aws-us-cdk-cloudfront-demo
- Owner: neilkuan
- License: apache-2.0
- Created: 2021-04-17T01:42:29.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-19T00:45:49.000Z (almost 4 years ago)
- Last Synced: 2024-12-07T12:44:45.950Z (about 1 month ago)
- Topics: aws-cdk, aws-cdk-constructs, aws-cloudfront, lambda-edge
- Language: TypeScript
- Homepage:
- Size: 141 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# This repo for AWS User Group `20210422` demo.
## To install node package
```bash
$ yarn
```## To diff
```bash
$ cdk diff
```## To deploy
```bash
$ cdk deploy
```## To destroy
```bash
$ cdk destroy
```On deploy completed, open the cloudfront URL with
```bash
# access the path with object existed in s3 bucket
$ curl http://Hello CDK!
# access the path with object un-existed in s3 bucket
$ curl -I http:///123
# response with the redirect message
HTTP/2 302
content-type: application/xml
content-length: 0
date: Fri, 22 Apr 2021 08:40:09 GMT
server: AmazonS3
location: /404.html # the custom error page defined in Lambda@Edge
x-cache: Miss from cloudfront
via: 1.1 xxx.cloudfront.net (CloudFront)
x-amz-cf-pop: SFO53-C1
x-amz-cf-id: xxx
```There would be 3 path you can access:
* `http:///index.html`
* `http:///error.html`
* `http:///404.html`