// Express app with health checks and graceful shutdown
const express = require('express');
const { createServer } = require('http');
const app = express();
const server = createServer(app);
// k6 Load Test Configuration
// Run: k6 run load-test.js --env BASE_URL=https://api.example.com
import http from 'k6/http';
import { check, sleep, group } from 'k6';
import { Rate, Trend, Counter } from 'k6/metrics';
# Using the module
module "api_service" {
source = "./modules/ecs_service"
service_name = "api"
#!/usr/bin/env bash
set -euo pipefail
# ==========================================================
# Production Incident Response Runbook
# ==========================================================
#!/usr/bin/env bash
# Docker Networking Modes & Configuration
# === List networks ===
docker network ls
docker network inspect bridge
# Main nginx.conf
worker_processes auto;
worker_rlimit_nofile 65535;
events {
// Structured logging with Winston (Node.js)
const winston = require('winston');
const { v4: uuidv4 } = require('uuid');
// Create logger
const logger = winston.createLogger({
package com.example.demo.feature;
import org.togglz.core.Feature;
import org.togglz.core.annotation.EnabledByDefault;
import org.togglz.core.annotation.Label;
import org.togglz.core.context.FeatureContext;
# Build stage
FROM maven:3.9-eclipse-temurin-21 AS build
WORKDIR /app
# Copy dependency definitions
COPY pom.xml .
# Configure Terraform
terraform {
required_version = ">= 1.6.0"
required_providers {
aws = {
#!/bin/bash
set -euo pipefail
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
#!/bin/bash
# Helm commands
# Add repositories
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update