Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

aws-samples/visitor-prioritization-switcher

Visitor Prioritization Switcher

Amazon CloudFront Function is used to achieve Visitor Prioritization. however operators need to turn on/off the functionalities manually by AWS management console. This samples shows how to do it automatically according to Amazon CloudWatch metrics, such as request count per minute.

Architecture

architecture

Amazon CloudWatch triggers AWS Lambda when the alarm kicks off and the AWS Lambda function update and publish the Amazon CloudFront Function. In this sample, the alarm kicks according to the request count to the Amazon CloudFront distribution. Please customize the metrics as you like. Also, You can customize how much of requests should be guided to the waiting room by adjusting the environment variable HITRATE_LIMITED for the AWS Lambda function. Please check CDK source too.

Deployment

Install dependencies

npm install

Bootstrap the AWS CDK

npm run cdk -- bootstrap --region us-east-1

Deploy the stack

npm run cdk deploy WaitingroomStack

If the deployment is successful, the CloudFront endpoint will be shown. Please access it with your favorite web browser. Reloading many times will trigger the alarm and you will be guided to the waitingroom.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published