https://github.com/msysh/aws-sample-cdk-custom-response-header-with-lambdaedge
Test custom response header with using Lambda@Edge, CloudFront and S3.
https://github.com/msysh/aws-sample-cdk-custom-response-header-with-lambdaedge
aws-cdk cloudfront lambda-edge
Last synced: 4 months ago
JSON representation
Test custom response header with using Lambda@Edge, CloudFront and S3.
- Host: GitHub
- URL: https://github.com/msysh/aws-sample-cdk-custom-response-header-with-lambdaedge
- Owner: msysh
- License: other
- Created: 2021-03-04T15:42:20.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-28T16:04:29.000Z (almost 5 years ago)
- Last Synced: 2025-08-10T06:22:51.176Z (6 months ago)
- Topics: aws-cdk, cloudfront, lambda-edge
- Language: TypeScript
- Homepage:
- Size: 155 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS Sample : test custom response header with Lambda@Edge
Test custom response header with using Lambda@Edge, CloudFront and S3..
## Quick Start
1. `git clone https://github.com/msysh/aws-sample-cdk-custom-response-header-with-lambdaedge.git`
2. `cd aws-sample-cdk-custom-response-header-with-lambdaedge`
3. `npm install` or `yarn install`
4. `cdk bootstrap`, if you've never execute yet.
5. `cdk deploy`
## Customize
### AWS Lambda function
Add files you want for AWS Lambda, into `assets`.
### Amazon CloudFront
Default status of distribution is set `false`.
### Others
* Lambda function name : `functionName` in `cdk.json`. Default is `cf-edge-custom-response-header`.
* IAM role name : `roleName` in `cdk.json`. Default is `cf-edge-custom-response-header`.
* S3 bucket name : `bucketName` in `cdk.json`. Default is `origin-bucket-for-custom-response-header`
---
The `cdk.json` file tells the CDK Toolkit how to execute your app.
## Useful commands
* `npm run build` compile typescript to js
* `npm run watch` watch for changes and compile
* `npm run test` perform the jest unit tests
* `cdk deploy` deploy this stack to your default AWS account/region
* `cdk diff` compare deployed stack with current state
* `cdk synth` emits the synthesized CloudFormation template