This is a very exaggerated and unnecessary way of implementing a simple web scraper that will periodically check if an item is in stock. But, I have no social life so might as well over-engineer something for vibes. After all, don't we all want to be 10x engineers 🙂
- AWS EventBridge Trigger: An EventBridge event triggers the Lambda function every 5 minutes.
- Lambda Function: The Lambda function makes a request to check if the item is in stock.
- Check Stock: If the item is in stock, the Lambda function publishes a message to an AWS SNS topic.
- SNS Subscription: There is a subscription (Pub/Sub) to the SNS topic that sends out an email informing about the item's availability.
- CloudWatch Logs: Logs are generated for Lambda function invocations and events.
- GitHub: The source code is stored in GitHub for version control.
- CDK and CloudFormation: Infrastructure is defined as code using CloudFormation or CDK.
- CodeBuild: CodeBuild is used for building and testing the code.
- CodePipeline: CodePipeline automates the CI/CD process.
This is a Java project with the following structure:
cdk.json
: Configuration file for the CDK Toolkit.pom.xml
: Maven configuration for building and managing dependencies.src/
: Source code directory containing your CDK stack implementations.README.md
: Project documentation.
mvn package
: Compile and run tests.cdk ls
: List all stacks in the app.cdk synth
: Emit the synthesized CloudFormation template.cdk deploy
: Deploy this stack to your default AWS account/region.cdk diff
: Compare deployed stack with the current state.cdk docs
: Open CDK documentation.