This repository contains the AWS CDK infrastructure for the Camply campsite availability checker. It includes a Lambda function that periodically checks for campsite availability and sends email notifications.
- Node.js (>= 18.0.0)
- AWS CLI configured with appropriate credentials
- AWS CDK installed globally (
npm install -g aws-cdk
)
npm install
npm run bootstrap
npm run build
Deployment Deploy to Development Environment To deploy the stacks to the development environment, run:
npm run deploy:dev
Deploy to Production Environment To deploy the stacks to the production environment, run:
npm run deploy:prod
The configuration for the project is managed using environment variables. Create a .env file in the root directory with the following content:
EMAIL_TO_ADDRESS="[email protected]"
EMAIL_USERNAME="[email protected]"
EMAIL_PASSWORD="your-email-password"
EMAIL_SMTP_SERVER="smtp.your-email-provider.com"
EMAIL_SMTP_PORT="465"
EMAIL_FROM_ADDRESS="[email protected]"
EMAIL_SUBJECT_LINE="Camply Notification"
The repository includes a GitHub Actions workflow for deploying the Lambda function. The workflow is defined in deploy.yml.
To run the tests, use:
npm test
The CamplyStack defined in camply-stack.ts
includes:
- An S3 bucket for caching
- A Lambda function for checking campsite availability
- An EventBridge rule to trigger the Lambda function periodically
The GithubActionsStack defined in github-actions-stack.ts
includes:
- An IAM role for GitHub Actions with permissions to deploy the CDK stacks