- Install Node.js (see
.nvmrcfor required version) - Install AWS CLI and configure credentials
- Get an API key from OpenWeatherMap
-
Clone the repository
-
Create a Secret in AWS Secrets Manager:
- Name:
weather-site-api-key - Value: Your OpenWeatherMap API key (plaintext)
- Name:
-
Copy
.env.exampleto.envand configure:cp .env.example .env
- Set required variables:
WEATHER_LOCATION_LAT,WEATHER_LOCATION_LON,LOCATION_NAME, etc. - Optionally set
ALERT_EMAILfor email notifications when site status changes or system failures occur - Leave
DOMAIN_NAMEempty for basic deployment
- Set required variables:
-
Install dependencies:
npm install
-
Set AWS profile (optional):
export AWS_PROFILE=<your_aws_profile>
Works out of the box with a CloudFront-generated domain (e.g., d123456789.cloudfront.net)
npm run deployThe CloudFront URL will be output to the console.
- Set
DOMAIN_NAMEin your.envfile - If your domain is not hosted in Route53, point your nameservers to Route53 (instructions)
- Deploy:
npm run deploy
CDK automatically deploys the domain stack to us-east-1 (required for CloudFront SSL certificates) and wires everything together via crossRegionReferences. The domain stack creates www → non-www redirects and DNS A records pointing to CloudFront.
Note: Certificate DNS validation can take up to 30 minutes. For non-Route53 domains, update nameservers quickly after deployment starts to prevent certificate validation failures.
To delete all resources:
npm run destroyManually delete the weather-site-api-key secret from AWS Secrets Manager.