hcl
# S3 bucket for static assets
resource "aws_s3_bucket" "assets" {
  bucket = "${var.project_name}-assets-${var.environment}"
}

resource "aws_s3_bucket_versioning" "assets" {

AWS S3 and CloudFront for static asset hosting

aws s3 cloudfront
by Ryan Nakamura 2 tabs
bash
#!/bin/bash
# Helm commands

# Add repositories
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

Kubernetes Helm charts for package management

kubernetes helm charts
by Ryan Nakamura 4 tabs
dockerfile
# Optimized production Dockerfile

# Stage 1: Dependencies
FROM node:20-alpine AS deps
WORKDIR /app

Docker image optimization and security scanning

docker optimization security
by Ryan Nakamura 2 tabs
yaml
---
# Main playbook
- name: Configure web servers
  hosts: webservers
  become: yes
  vars:

Ansible playbooks for configuration management

ansible configuration-management devops
by Ryan Nakamura 2 tabs
yaml
# Pre-commit hooks configuration
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: trailing-whitespace

Git workflows and branching strategies for teams

git workflows branching
by Ryan Nakamura 2 tabs
yaml
# Install cert-manager (Helm)
# helm install cert-manager jetstack/cert-manager #   --namespace cert-manager #   --create-namespace #   --set installCRDs=true

---
# ClusterIssuer for Let's Encrypt (staging)
apiVersion: cert-manager.io/v1

SSL/TLS certificates with Lets Encrypt and cert-manager

ssl tls certificates
by Ryan Nakamura 2 tabs
hcl
# ECS Task Execution Role (pull images, push logs)
resource "aws_iam_role" "ecs_execution" {
  name = "${var.project_name}-ecs-execution"

  assume_role_policy = jsonencode({
    Version = "2012-10-17"

AWS IAM policies and security best practices

aws iam security
by Ryan Nakamura 1 tab
javascript
// Structured logging with Winston (Node.js)
const winston = require('winston');
const { v4: uuidv4 } = require('uuid');

// Create logger
const logger = winston.createLogger({

Structured logging with ELK stack integration

logging elk elasticsearch
by Ryan Nakamura 2 tabs
yaml
# Grafana provisioning: datasources
# /etc/grafana/provisioning/datasources/prometheus.yml
apiVersion: 1
datasources:
  - name: Prometheus
    type: prometheus

Grafana dashboards as code with JSON provisioning

grafana dashboards monitoring
by Ryan Nakamura 2 tabs
yaml
# Prometheus configuration
global:
  scrape_interval: 15s
  evaluation_interval: 15s
  scrape_timeout: 10s

Prometheus monitoring and alerting configuration

prometheus monitoring alerting
by Ryan Nakamura 2 tabs
nginx
# Main nginx.conf

worker_processes auto;
worker_rlimit_nofile 65535;

events {

Nginx reverse proxy and load balancing

nginx reverse-proxy load-balancing
by Ryan Nakamura 1 tab
bash
#!/bin/bash
set -euo pipefail

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'

Shell scripting for DevOps automation

bash shell-scripting devops
by Ryan Nakamura 1 tab