Setting my own rules

Published: (February 7, 2026 at 04:45 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

Background

In my normal work I rarely get the opportunity to build with AWS services that aren’t approved for use within my company. That’s why using services like AWS Amplify in a personal project feels a bit scandalous—like jumping out the window to attend a party I’ve been told I can’t go to. It’s funny to finally experience setting my own rules for how I want to use technology, unlocking new levels I didn’t expect.

Using AWS Amplify

Amplify lives up to its promise of rapid deployment. After using Copilot to scaffold a React frontend, Amplify immediately deployed the app. I configured the Amplify application to auto‑detect branches and auto‑build, so any push that compiled triggered a fully handled build and deployment pipeline.

Choosing Not to Use Amplify’s Backend Features

I decided not to integrate Amplify directly with functions, storage, or data options. While those integrations are a major perk, I wanted more control:

  • API Gateway – I use it to expose my Lambdas, allowing granular validation and error handling.
  • Managed Authorizer – Protects the Lambdas that call Bedrock models for content generation and download content from S3.
  • Backend Language – I prefer to write the backend in a language I’m comfortable with rather than TypeScript. The React frontend is enough learning for me in 2026.

Terraform Experiment

In a previous post I asked how others deploy resources for personal projects. This time I chose to create Terraform (TF) after a manual deployment, mainly because I’m not familiar with the Amplify resources in the provider. I wanted to see if I could quickly generate the Terraform needed to replicate the console configuration.

A common friction point in my day‑to‑day job is writing Terraform to provision resources. The current AWS Terraform provider doesn’t expose resources for managing or customizing monitoring or alerting for Amplify apps, so those aspects still need to be handled in the console.

Example Terraform Configuration

Below is the Terraform snippet I used to configure Amplify for deploying my frontend app:

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"

    # 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" # Local development redirect
    # For production: VITE_COGNITO_REDIRECT_URI = "https://your-domain.com"

    # API Configuration
    # Main API Gateway URL for backend endpoints
    VITE_API_ENDPOINT = "https://your-api-gateway.execute-api.us-east-1.amazonaws.com/prod"
  }
}
0 views
Back to Blog

Related posts

Read more »

The Origin of the Lettuce Project

Two years ago, Jason and I started what became known as the BLT Lettuce Project with a very simple goal: make it easier for newcomers to OWASP to find their way...