# RDS PostgreSQL instance
resource "aws_db_instance" "main" {
identifier = "${var.project_name}-db"
engine = "postgres"
engine_version = "16.1"
# Using the module
module "api_service" {
source = "./modules/ecs_service"
service_name = "api"
# Configure Terraform
terraform {
required_version = ">= 1.6.0"
required_providers {
aws = {
stages:
- lint
- test
- build
- deploy
name: CI Pipeline
on:
push:
branches: [main, develop]
pull_request:
# HPA v2 with multiple metrics
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web-app-hpa
namespace: production
# ConfigMap from literal values
apiVersion: v1
kind: ConfigMap
metadata:
name: web-app-config
namespace: production
# ClusterIP Service (internal only)
apiVersion: v1
kind: Service
metadata:
name: web-app
namespace: production
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app
namespace: production
labels:
#!/bin/bash
# Docker Compose commands
# Start all services
docker compose up -d
# Multi-stage build for a Node.js application
# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
/* 1. Mobile-first approach */
/* Base styles for mobile */
.container {
width: 100%;
padding: 1rem;
}