Deploying on aws

From ancoleman/ai-design-components · View interactive version

Deploying on aws is an AI agent skill from the GitHub repository ancoleman/ai-design-components. Selecting and implementing AWS services and architectural patterns. Use when designing AWS cloud architectures, choosing compute/storage/database services, implementing serverless or container patterns, or applying AWS Well-Architected Framework principles.

How to use this skill

Skill file

AWS Patterns

Purpose

This skill provides decision frameworks and implementation patterns for Amazon Web Services. Navigate AWS's 200+ services through proven selection criteria, architectural patterns, and Well-Architected Framework principles. Focus on practical service selection, cost-aware design, and modern 2025 patterns including Lambda SnapStart, EventBridge Pipes, and S3 Express One Zone.

Use this skill when designing AWS solutions, selecting services for specific workloads, implementing serverless or container architectures, or optimizing existing AWS infrastructure for cost, performance, and reliability.

When to Use This Skill

Invoke this skill when:

Core Service Selection Frameworks

Compute Service Selection

Decision Flow:

Execution Duration:
  <15 minutes → Evaluate Lambda
  >15 minutes → Evaluate containers or VMs

Event-Driven/Scheduled:
  YES → Lambda (serverless)
  NO → Consider traffic patterns

Containerized:
  YES → Need Kubernetes?
    YES → EKS
    NO → ECS (Fargate or EC2)
  NO → Evaluate EC2 or containerize first

Special Requirements:
  GPU/Windows/BYOL licensing → EC2
  Predictable high traffic → EC2 or ECS on EC2 (cost optimization)
  Variable traffic → Lambda or Fargate

Quick Reference:

| Workload | Primary Choice | Cost Model | Key Benefit |

|----------|---------------|------------|-------------|

| API Backend | Lambda + API Gateway | Pay per request | Auto-scale, no servers |

| Microservices | ECS on Fargate | Pay for runtime | Simple operations |

| Kubernetes Apps | EKS | $73/mo + compute | Portability, ecosystem |

| Batch Jobs | Lambda or Fargate Spot | Request/spot pricing | Cost efficiency |

| Long-Running | EC2 Reserved Instances | 30-60% savings | Predictable cost |

For detailed service comparisons including cost examples, performance characteristics, and use case guidance, see references/compute-services.md.

Database Service Selection

Decision Matrix by Access Pattern:

| Access Pattern | Data Model | Primary Choice | Key Criteria |

|----------------|------------|----------------|--------------|

| Transactional (OLTP) | Relational | Aurora | Performance + HA |

| Simple CRUD | Relational | RDS PostgreSQL | Cost vs. features |

| Key-Value Lookups | NoSQL | DynamoDB | Serverless scale |

| Document Storage | JSON/BSON | DynamoDB | Flexibility vs. MongoDB compat |

| Caching | In-Memory | ElastiCache Redis | Speed + durability |

| Analytics (OLAP) | Columnar | Redshift/Athena | Dedicated vs. serverless |

| Time-Series | Timestamped | Timestream | Purpose-built |

Query Complexity Guide:

For storage class selection, cost comparisons, and migration patterns, see references/database-services.md.

Storage Service Selection

Primary Decision Tree:

Data Type:
  Objects (files, media) → S3 + lifecycle policies
  Blocks (databases, boot volumes) → EBS
  Shared Files (cross-instance) → Evaluate protocol

File Protocol Required:
  NFS (Linux) → EFS
  SMB (Windows) → FSx for Windows
  High-Performance HPC → FSx for Lustre
  Multi-Protocol + Enterprise → FSx for NetApp ONTAP

Cost Comparison (1TB/month):

| Service | Monthly Cost | Access Pattern |

|---------|--------------|----------------|

| S3 Standard | $23 | Frequent access |

| S3 Standard-IA | $12.50 | Infrequent (>30 days) |

| S3 Glacier Instant | $4 | Archive, instant retrieval |

| EBS gp3 | $80 | Block storage |

| EFS Standard | $300 | Shared files, frequent |

| EFS IA | $25 | Shared files, infrequent |

Recommendation: Use S3 for 80%+ of storage needs. Use EFS/FSx only when shared file access is required.

For S3 storage classes, EBS volume types, and lifecycle policy examples, see references/storage-services.md.

Serverless Architecture Patterns

Pattern 1: REST API (Lambda + API Gateway + DynamoDB)

Architecture:

Client → API Gateway (HTTP API) → Lambda → DynamoDB
                                        ↓
                                       S3 (file uploads)

Use When:

Cost Estimate (1M requests/month):

Key Components:

See examples/cdk/serverless-api/ and examples/terraform/serverless-api/ for complete implementations.

Pattern 2: Event-Driven Processing (EventBridge + Lambda + SQS)

Architecture:

S3 Upload → EventBridge Rule → Lambda (process) → DynamoDB (metadata)
                                              ↓
                                            SQS (downstream tasks)

Use When:

Key Features (2025):

See references/serverless-patterns.md for additional patterns including Step Functions orchestration, API Gateway WebSockets, and Lambda SnapStart configuration.

Container Architecture Patterns

Pattern 1: ECS on Fargate (Serverless Containers)

Architecture:

ALB → ECS Service (Fargate tasks) → RDS Aurora
                                 ↓
                           ElastiCache Redis

Use When:

Key Components:

Cost Model (2 vCPU, 4GB RAM, 24/7):

Pattern 2: EKS (Kubernetes on AWS)

Use When:

Key Features (2025):

Cost Considerations:

For ECS task definitions, EKS cluster setup with CDK/Terraform, and service mesh patterns, see references/container-patterns.md.

Networking Essentials

VPC Architecture

Standard 3-Tier Pattern:

VPC: 10.0.0.0/16

Per Availability Zone (deploy across 3 AZs):
  Public Subnet:    10.0.X.0/24   (ALB, NAT Gateway)
  Private Subnet:   10.0.1X.0/24  (ECS, Lambda, app tier)
  Database Subnet:  10.0.2X.0/24  (RDS, Aurora, isolated)

Best Practices:

Load Balancing

Service Selection:

| Load Balancer | Protocol | Use Case | Key Feature |

|---------------|----------|----------|-------------|

| ALB | HTTP/HTTPS | Web apps, APIs | Path/host routing, Lambda targets |

| NLB | TCP/UDP | High performance | Static IP, ultra-low latency |

| GWLB | Layer 3 | Security appliances | Inline inspection |

ALB Features:

For CloudFront CDN patterns, Route 53 routing policies, and VPC peering configurations, see references/networking.md.

Security Best Practices

IAM Principles

Least Privilege Pattern:

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": ["s3:GetObject", "s3:PutObject"],
    "Resource": "arn:aws:s3:::my-bucket/uploads/*"
  }]
}

Core Practices:

Data Protection

Encryption Requirements:

| Service | At-Rest Encryption | In-Transit Encryption |

|---------|-------------------|----------------------|

| S3 | SSE-S3 or SSE-KMS | HTTPS (TLS 1.2+) |

| EBS | KMS encryption | N/A (within instance) |

| RDS/Aurora | KMS encryption | TLS connections |

| DynamoDB | KMS encryption | HTTPS API |

Secrets Management:

For WAF rules, GuardDuty configuration, and network security patterns, see references/security.md.

AWS Well-Architected Framework

Six Pillars Overview

1. Operational Excellence

2. Security

3. Reliability

4. Performance Efficiency

5. Cost Optimization

6. Sustainability (Added 2024)

For detailed pillar implementation guides, architectural review checklists, and Well-Architected Tool integration, see references/well-architected.md.

Infrastructure as Code

Tool Selection

AWS CDK (Cloud Development Kit):

Terraform:

CloudFormation:

CDK Quick Start

# Install CDK CLI
npm install -g aws-cdk

# Initialize new project
cdk init app --language=typescript
npm install

# Deploy infrastructure
cdk bootstrap  # One-time setup
cdk deploy

Terraform Quick Start

# Install Terraform
brew install terraform  # macOS

# Initialize project
terraform init

# Preview changes
terraform plan

# Apply changes
terraform apply

For complete working examples with VPC networking, multi-tier applications, and event-driven architectures, see the examples/ directory.

Cost Optimization Strategies

Compute Cost Optimization

Right-Sizing:

Pricing Models:

| Model | Commitment | Savings | Best For |

|-------|------------|---------|----------|

| On-Demand | None | 0% | Variable workloads |

| Savings Plans | 1-3 years | 30-40% | Flexible compute |

| Reserved Instances | 1-3 years | 30-60% | Predictable workloads |

| Spot Instances | None | 60-90% | Fault-tolerant tasks |

Graviton Advantage:

Storage Cost Optimization

S3 Lifecycle Policies:

Day 0-30:    S3 Standard         ($0.023/GB)
Day 30-90:   S3 Standard-IA      ($0.0125/GB)
Day 90-365:  S3 Glacier Instant  ($0.004/GB)
Day 365+:    S3 Deep Archive     ($0.00099/GB)

EBS Optimization:

Monitoring:

Common Patterns and Examples

Serverless Three-Tier Application

CloudFront (CDN)
  → S3 (React frontend)
  → API Gateway (REST API)
    → Lambda (business logic)
      → DynamoDB (data)
      → S3 (file storage)

Complete CDK implementation: examples/cdk/three-tier-app/

Complete Terraform implementation: examples/terraform/three-tier-app/

Containerized Microservices

Route 53 (DNS)
  → CloudFront (CDN)
    → ALB (load balancer)
      → ECS Fargate (services)
        → RDS Aurora (database)
        → ElastiCache Redis (cache)

Complete implementation: examples/cdk/ecs-fargate/

Event-Driven Data Pipeline

S3 Upload
  → EventBridge Rule
    → Lambda (transform)
      → Kinesis Firehose
        → S3 Data Lake
          → Athena (query)

Complete implementation: examples/cdk/event-driven/

Integration with Other Skills

Related Skills

Cross-Skill Patterns

EKS + kubernetes-operations:

Secrets Management:

CI/CD Integration:

Reference Documentation

Detailed Guides

Working Examples

Utility Scripts

AWS Service Updates (2025)

Recent Innovations to Consider:


Quick Decision Checklist

Before choosing a service, answer:

  1. Traffic Pattern: Predictable or variable? (affects compute choice)
  2. Data Model: Relational, key-value, document, or graph? (affects database choice)
  3. Access Pattern: Frequent, infrequent, or archive? (affects storage class)
  4. Latency Requirements: Milliseconds, seconds, or minutes acceptable?
  5. Scaling Needs: Vertical (bigger instances) or horizontal (more instances)?
  6. Operational Overhead: Prefer managed services or need control?
  7. Cost Sensitivity: Optimize for cost, performance, or balance?
  8. Compliance Requirements: Data residency, encryption, audit logging needed?

Then consult the relevant decision framework in this skill or detailed references.

Getting Started

For New AWS Projects:

  1. Define architecture using Well-Architected Framework pillars
  2. Choose compute service using decision tree (Lambda/Fargate/ECS/EKS/EC2)
  3. Select database based on access patterns and data model
  4. Design VPC with 3-tier subnet architecture
  5. Implement IaC using CDK or Terraform (see examples/)
  6. Apply security best practices (IAM, encryption, logging)
  7. Set up monitoring and cost tracking

For Existing AWS Projects:

  1. Run AWS Trusted Advisor for recommendations
  2. Review Well-Architected Framework pillars
  3. Optimize costs (right-size, Reserved Instances, storage lifecycle)
  4. Migrate to modern services (EC2 → Fargate, RDS → Aurora)
  5. Improve security posture (enable GuardDuty, implement least privilege)
  6. Automate with IaC (reverse-engineer to Terraform or CDK)
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.