Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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`