Deployment Verification
After deploying the Serverless CMS platform, use these automated verification scripts to ensure all AWS resources are provisioned correctly and functioning as expected.
scripts/
directory of your project.
Quick Start
Run the comprehensive verification script:
cd scripts
chmod +x verify-deployment.sh
./verify-deployment.sh
This will check all 13 components and 53 Lambda functions.
Verification Scripts
1. verify-deployment.sh (Bash)
Comprehensive deployment verification with color-coded output.
Features
- Verifies all AWS resources (Cognito, Lambda, DynamoDB, S3, API Gateway, CloudFront, Route 53)
- Checks 53 Lambda functions (47 cms + 1 publisher + 5 public)
- Tests endpoint accessibility
- Color-coded pass/fail/warning indicators
- Exit code indicates overall success/failure
Usage
# Default profile (cms-deploy)
./verify-deployment.sh
# Custom profile
AWS_PROFILE=my-profile ./verify-deployment.sh
# Custom region
AWS_REGION=us-east-1 ./verify-deployment.sh
Requirements
- AWS CLI installed and configured
- Bash shell
jq(optional, for better JSON parsing)
2. health-check.sh (Bash)
Ongoing health monitoring for deployed resources.
Features
- Monitors Lambda function health and update status
- Checks DynamoDB for throttling
- Verifies S3 bucket accessibility
- Tests API Gateway endpoints
- Monitors CloudWatch errors
- Measures endpoint response times
Usage
# Run health check
./health-check.sh
# Schedule with cron (every 5 minutes)
*/5 * * * * /path/to/scripts/health-check.sh >> /var/log/cms-health.log 2>&1
3. verify-resources.js (Node.js)
Detailed verification with JSON output for automation.
Features
- Uses AWS SDK v3 for programmatic access
- Generates detailed JSON report
- Suitable for CI/CD integration
- Captures resource metadata (IDs, names, counts)
- Writes results to
verification-results.json
Usage
# Install dependencies first
npm install
# Run verification
npm run verify
# Or run directly
node verify-resources.js
Expected Resources
The verification scripts check for the following AWS resources:
Authentication (Global/eu-west-2)
Cognito User Pool
- Count: 1 User Pool
- System Groups: 4
adminsite-creatorsite-editorauthentication-admin
Compute (eu-west-2)
Lambda Functions
- Total: 53 functions
- cms-functions: 47 handlers
- publisher-function: 1 handler
- public-functions: 5 handlers
- Runtime: Node.js 22.x (all functions)
Storage (eu-west-2)
DynamoDB Table
- Table Name:
serverless-cms-content-store - Status: ACTIVE
- Features: Global Secondary Indexes (GSI)
S3 Buckets
- Total: 5 buckets
serverless-cms-deploy-artifacts-*serverless-cms-component-store-*serverless-cms-asset-store-*serverless-cms-publish-store-*serverless-cms-backup-store-*
APIs (eu-west-2)
API Gateway
- CMS_API: Authenticated, 47 routes
- Public_API: Public access, 5 routes
CDN (Global)
CloudFront Distributions
- Total: 2 distributions
- Admin Tool: Serves React SPA
- Publish Store: Serves published websites
- Status: Deployed (takes 15-30 minutes)
DNS (Global)
Route 53
- Hosted Zone: For root domain
- DNS Records: 3 subdomains
admin.{rootDomain}cms-api.{rootDomain}api.{rootDomain}
Verification Output
Successful Verification
========================================
Serverless CMS Deployment Verification
========================================
--- Checking Prerequisites ---
✓ AWS CLI installed
✓ jq installed
✓ AWS credentials configured for profile: cms-deploy
--- Verifying Cognito User Pool ---
✓ Cognito User Pool found: eu-west-2_xxxxxxxxx
✓ System group exists: admin
✓ System group exists: site-creator
✓ System group exists: site-editor
✓ System group exists: authentication-admin
--- Verifying Lambda Functions ---
✓ Lambda functions found: 53 (expected: 53)
✓ All Lambda functions use correct runtime (nodejs22.x)
--- Verifying DynamoDB Table ---
✓ DynamoDB table exists and is ACTIVE
✓ Global Secondary Indexes configured: 2
--- Verifying S3 Buckets ---
✓ S3 bucket exists: serverless-cms-deploy-artifacts-xxxxx
✓ S3 bucket exists: serverless-cms-component-store-xxxxx
✓ S3 bucket exists: serverless-cms-asset-store-xxxxx
✓ S3 bucket exists: serverless-cms-publish-store-xxxxx
✓ S3 bucket exists: serverless-cms-backup-store-xxxxx
--- Verifying API Gateway ---
✓ CMS API Gateway found: xxxxxxxxxx
✓ Public API Gateway found: xxxxxxxxxx
--- Verifying CloudFront Distributions ---
✓ CloudFront distributions found: 2 (expected: 2)
✓ Distribution E1234567890ABC: Deployed
--- Verifying Route 53 DNS Records ---
✓ Route 53 hosted zone found: Z1234567890ABC
✓ DNS record exists: admin.example.com
✓ DNS record exists: cms-api.example.com
✓ DNS record exists: api.example.com
--- Testing Endpoints ---
✓ Admin Tool accessible: https://admin.example.com
✓ CMS API accessible: https://cms-api.example.com/sites (returns 401 as expected)
✓ Public API accessible: https://api.example.com/sites/test/meta (returns 404)
--- Verification Summary ---
Total checks: 45
Passed: 45
Failed: 0
Warnings: 0
✓ All critical checks passed!
Failed Verification
--- Verifying Lambda Functions ---
⚠ Lambda functions found: 48 (expected: 53)
✗ 2 Lambda functions have incorrect runtime
--- Verification Summary ---
Total checks: 45
Passed: 40
Failed: 2
Warnings: 3
✗ Some checks failed. Review the output above.
Common Issues
CloudFront Distributions Not Deployed
Solution: CloudFront distributions take 15-30 minutes to deploy. Wait and re-run verification.
DNS Records Not Found
Solution: Verify hosted zone exists and deployment completed successfully. DNS propagation can take up to 48 hours.
Lambda Functions Missing
Solution: Check deployment logs. Re-run deployment if necessary:
mvn clean package serverless:deploy
API Gateway Returns 000
Solution: DNS may not be propagated yet. Wait and retry. Check CloudFront distribution status.
Manual Verification
If automated scripts fail, you can manually verify resources using AWS CLI:
Check Cognito User Pool
aws cognito-idp list-user-pools \
--max-results 10 \
--profile cms-deploy \
--region eu-west-2
Check Lambda Functions
aws lambda list-functions \
--profile cms-deploy \
--region eu-west-2 \
| grep serverless-cms
Check DynamoDB Table
aws dynamodb describe-table \
--table-name serverless-cms-content-store \
--profile cms-deploy \
--region eu-west-2
Check S3 Buckets
aws s3 ls --profile cms-deploy | grep serverless-cms
Check API Gateway
aws apigateway get-rest-apis \
--profile cms-deploy \
--region eu-west-2
Check CloudFront Distributions
aws cloudfront list-distributions --profile cms-deploy
Check Route 53 Records
aws route53 list-hosted-zones --profile cms-deploy
CI/CD Integration
Integrate verification into your CI/CD pipeline:
GitHub Actions
name: Verify Deployment
on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *' # Every 6 hours
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- name: Run Verification
run: |
cd scripts
chmod +x verify-deployment.sh
./verify-deployment.sh
Monitoring Setup
Cron Job for Regular Health Checks
# Health check every 5 minutes
*/5 * * * * /path/to/scripts/health-check.sh >> /var/log/cms-health.log 2>&1
# Full verification daily at 2 AM
0 2 * * * /path/to/scripts/verify-deployment.sh >> /var/log/cms-verify.log 2>&1
CloudWatch Alarms
# Lambda error alarm
aws cloudwatch put-metric-alarm \
--alarm-name serverless-cms-lambda-errors \
--alarm-description "Alert on Lambda errors" \
--metric-name Errors \
--namespace AWS/Lambda \
--statistic Sum \
--period 300 \
--evaluation-periods 1 \
--threshold 10 \
--comparison-operator GreaterThanThreshold \
--profile cms-deploy \
--region eu-west-2