AWS Amplify
Source: Dev.to
Overview
I wanted to take a moment to double‑click on AWS Amplify after mentioning it in a previous post and share what I’ve learned while working on frontend development. Amplify lives up to its promise of rapid deployment: just as quickly as I used Copilot to scaffold a React app, Amplify immediately built and deployed it. With auto‑detect branches and auto‑build enabled, any push that compiles triggers a fully handled build and deployment pipeline.
Choosing Not to Integrate Amplify Backend Features
I deliberately avoided wiring Amplify directly to functions, storage, and data services. While Amplify can provision and manage many AWS resources for you, I wanted finer‑grained control. I opted to use API Gateway to front my Lambdas, allowing custom validation and error handling. A managed authorizer protects the Lambdas that invoke Bedrock models and retrieve objects from S3. I also prefer not to write the backend in TypeScript—React is enough learning for me in 2026, and I’ll use a language I’m more comfortable with for the backend.
Terraform vs. Manual Deployment
In an earlier post I asked how others deploy resources for personal projects. This entry shows why I moved from manual console setup to Terraform, despite my limited familiarity with the Amplify resources exposed by the provider. The experience highlighted a common friction point: the current AWS Terraform provider does not expose resources for monitoring or alerting of Amplify apps, so those aspects still need to be configured manually in the console.
Example Terraform Configuration
resource "aws_amplify_app" "homeschool_app" {
name = "homeschool-app"
repository = "https://github.com/homeschool-app" # Replace with your GH repository
build_spec = <<-EOT
version: 1
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
EOT
enable_auto_branch_creation = true
auto_branch_creation_patterns = [
"*",
"*/**",
]
auto_branch_creation_config {
enable_auto_build = true
}
environment_variables = {
# Cognito User Pool Domain (without the .auth.region.amazoncognito.com part)
VITE_COGNITO_DOMAIN = "your-cognito-domain"
# Cognito User Pool App Client ID
VITE_COGNITO_CLIENT_ID = "your-cognito-client-id"
# Example: VITE_COGNITO_CLIENT_ID=1a2b3c4d5e6f7g8h9i0j1k2l3m
# AWS Region (optional - defaults to us-east-1)
VITE_AWS_REGION = "us-east-1"
# Redirect URI after successful login (optional - defaults to current origin)
VITE_COGNITO_REDIRECT_URI = "http://localhost:3000"
# For production: VITE_COGNITO_REDIRECT_URI=https://your-domain.com
# API Configuration
# Main API Gateway URL for general endpoints
VITE_API_ENDPOINT = "https://your-api-gateway.execute-api.us-east-1.amazonaws.com/prod"
}
}
Conclusion
Amplify makes front‑end deployment a breeze, but when you need tighter control over backend services, combining API Gateway, Lambda, and Terraform gives you the flexibility and visibility that a fully managed Amplify stack currently lacks. This approach also surfaces gaps in the Terraform provider that may need manual handling—something to keep in mind for future projects.