Deploy the Weather Platform to production using AWS Amplify Hosting with CloudFormation-managed infrastructure.
ws1-amplify
configured with deployment permissionsBuild and test locally:
# Build the Next.js application
pnpm build
# Test the production build locally
pnpm start
Commit all changes:
# Ensure all backend configuration changes are committed
git add .
git commit -m "Update backend configuration for production deployment"
git push origin main
Method A: AWS Amplify Console (Recommended)
Go to AWS Amplify Console
Click “New app” → “Host web app”
Connect your Git repository:
prod
branch
version: 1
backend:
phases:
preBuild:
commands:
- export NODE_OPTIONS="--max-old-space-size=3072"
build:
commands:
- corepack enable
- pnpm install --frozen-lockfile
- pnpm exec ampx pipeline-deploy --branch $AWS_BRANCH --app-id
$AWS_APP_ID
frontend:
phases:
preBuild:
commands:
- export NODE_OPTIONS="--max-old-space-size=4096"
build:
commands:
- pnpm run build
artifacts:
baseDirectory: .next
files:
- "**/*"
Environment variables (if needed):
NODE_ENV
: production
Deploy: Click “Save and deploy”
Amplify automatically creates:
Backend resources deployed:
weather-dataset-{account-id}-main
)For each user, manually attach IoT policies (see Section 5.7):
# Get user's Cognito Identity ID and attach policy
aws iot attach-policy --policy-name WeatherPlatformPubSubPolicy \
--target "us-east-1:12345678-1234-1234-1234-123456789012" \
--profile ws1-amplify
weather.yourdomain.com
Frontend verification:
Backend verification:
CloudWatch dashboards:
Amplify Console features:
Common deployment issues:
Build failures:
# Check build logs in Amplify Console
# Verify dependencies in package.json
Backend deployment errors:
# Check CloudFormation events
# Verify IAM permissions
Domain issues:
# Verify DNS configuration
# Check SSL certificate status
CloudFormation Advantage: Amplify uses CloudFormation for infrastructure deployment, ensuring consistent, repeatable deployments with automatic rollback on failures.
Production deployment typically takes 10-15 minutes for initial setup. Subsequent deployments take 5-7 minutes for frontend changes only.