Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ coder login $CODER_AGENT_URL
```

## [Coder Templates](templates/README.md)
Four specialized workspace templates for AWS development:
Five specialized workspace templates for AWS development:
- **Linux Q Developer**: AI-powered development with Amazon Q Developer CLI
- **Linux SAM**: Serverless development with AWS SAM CLI on ARM64
- **Windows DCV**: Windows development with NICE DCV remote desktop
- **Kubernetes with Claude Code**: Cloud-native development with AI task automation
- **RAG with Claude Code**: RAG application prototyping with vector database

## Workshop Content

Expand Down
32 changes: 23 additions & 9 deletions templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,22 @@ This directory contains Coder workspace templates designed for AWS development w
**Key Tools**: Claude Code AI assistant, VS Code, Cursor, container tools
**Best For**: Microservices, container orchestration, AI-driven task automation

### 🤖 [RAG with Claude Code](awshp-k8s-rag-with-claude-code/)
**Purpose**: RAG application prototyping with vector database
**Architecture**: Kubernetes pods with Aurora PostgreSQL Serverless v2
**Key Tools**: Claude Code, pgvector, AWS Bedrock, Streamlit, Python tooling
**Best For**: AI/ML applications, vector search, RAG prototyping, data science

## Template Comparison

| Feature | Linux Q Developer | Linux SAM | Windows DCV | K8s Claude Code |
|---------|------------------|-----------|-------------|-----------------|
| **Platform** | Ubuntu x86_64 | Ubuntu ARM64 | Windows Server | Kubernetes |
| **AI Assistant** | Q Developer CLI | Q Developer Extension | - | Claude Code |
| **Primary Use** | General AWS Dev | Serverless | Windows Dev | Container Dev |
| **Cost Efficiency** | Standard | High (ARM64) | Higher | Variable |
| **Persistence** | Full VM | Full VM | Full VM | Home directory |
| **Startup Time** | ~2-3 min | ~2-3 min | ~5-10 min | ~30-60 sec |
| Feature | Linux Q Developer | Linux SAM | Windows DCV | K8s Claude Code | RAG Claude Code |
|---------|------------------|-----------|-------------|-----------------|-----------------|
| **Platform** | Ubuntu x86_64 | Ubuntu ARM64 | Windows Server | Kubernetes | Kubernetes |
| **AI Assistant** | Q Developer CLI | Q Developer Extension | - | Claude Code | Claude Code |
| **Primary Use** | General AWS Dev | Serverless | Windows Dev | Container Dev | RAG/AI Dev |
| **Cost Efficiency** | Standard | High (ARM64) | Higher | Variable | Variable |
| **Persistence** | Full VM | Full VM | Full VM | Home directory | Home directory |
| **Startup Time** | ~2-3 min | ~2-3 min | ~5-10 min | ~30-60 sec | ~5-10 min |

## Getting Started

Expand Down Expand Up @@ -72,6 +78,12 @@ This directory contains Coder workspace templates designed for AWS development w
- Microservices architecture
- Fast workspace startup times

**Choose RAG Claude Code if you want:**
- RAG application development
- Vector database integration
- AI/ML prototyping with Bedrock
- Streamlit-based data applications

## Configuration

### IAM Instance Profile
Expand All @@ -83,12 +95,14 @@ All templates support multi-region deployment with region-specific optimizations
- **Linux SAM**: 4 US regions (ARM64 availability)
- **Windows DCV**: 15 regions globally
- **Kubernetes**: Depends on cluster location
- **RAG**: Depends on cluster location + Aurora availability

### Resource Sizing
Each template offers configurable resource options:
- **CPU**: 1-4 vCPUs depending on template
- **CPU**: 1-8 vCPUs depending on template
- **Memory**: 1-16 GiB RAM options
- **Storage**: 10-300 GB persistent volumes
- **Database**: Aurora Serverless v2 (0.5-1.0 ACU for RAG template)

## Workshop Integration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ variable "db_master_password" {
default = "YourStrongPasswordHere1" # Consider using AWS Secrets Manager for production
}

variable "postgresql_version" {
description = "PostgreSQL database version"
type = string
default = "16.8"
}

# Get EKS cluster info
data "aws_eks_cluster" "current" {
name = var.eks_cluster_name # Add this variable
Expand Down Expand Up @@ -90,7 +96,7 @@ resource "aws_rds_cluster" "awsrag_aurora_postgres_1" {
cluster_identifier = "${var.workspace_name}-pgvector01"
engine = "aurora-postgresql"
engine_mode = "provisioned"
engine_version = "16.6"
engine_version = var.postgresql_version
database_name = var.database_name
master_username = var.db_master_username
master_password = var.db_master_password # Use AWS Secrets Manager in production
Expand All @@ -109,7 +115,7 @@ resource "aws_rds_cluster_instance" "awsrag_aurora_primary" {
cluster_identifier = aws_rds_cluster.awsrag_aurora_postgres_1.id
instance_class = "db.serverless"
engine = "aurora-postgresql"
engine_version = "16.6"
engine_version = var.postgresql_version
db_subnet_group_name = aws_db_subnet_group.awsrag_aurora_subnet_group.name
identifier = "${var.workspace_name}-primary"
}
Expand Down
127 changes: 76 additions & 51 deletions templates/awshp-k8s-rag-with-claude-code/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,59 +18,83 @@ terraform {
variable "eks_cluster_name" {
type = string
description = "The AWS EKS Kubernetes cluster name that Coder is deployed within."
default = "coder-eks-cluster"
}

variable "namespace" {
type = string
description = "The Kubernetes namespace to create workspaces in (must exist prior to creating workspaces). If the Coder host is itself running as a Pod on the same Kubernetes cluster as you are deploying workspaces to, set this to the same namespace."
default = "coder"
}

variable "anthropic_model" {
type = string
description = "The AWS Inference profile ID of the base Anthropic model to use with Claude Code"
default = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
}

variable "anthropic_small_fast_model" {
type = string
description = "The AWS Inference profile ID of the small fast Anthropic model to use with Claude Code"
default = "global.anthropic.claude-haiku-4-5-20251001-v1:0"
}

variable "postgresql_version" {
type = string
description = "The AWS Aurora PostgreSQL Database Engine Version to deploy"
default = "16.8"
}

locals {
home_dir = "/home/coder"
}

# Minimum vCPUs needed
data "coder_parameter" "cpu" {
name = "cpu"
display_name = "CPU"
description = "The number of CPU cores"
default = "2"
icon = "/icon/memory.svg"
mutable = true
option {
name = "2 Cores"
value = "2"
}
option {
name = "4 Cores"
value = "4"
name = "CPU cores"
type = "number"
description = "CPU cores for your individual workspace"
icon = "https://png.pngtree.com/png-clipart/20191122/original/pngtree-processor-icon-png-image_5165793.jpg"
validation {
min = 4
max = 8
}
form_type = "input"
mutable = true
default = 4
order = 1
}

# Minimum GB memory needed
data "coder_parameter" "memory" {
name = "memory"
display_name = "Memory"
description = "The amount of memory in GB"
default = "4"
icon = "/icon/memory.svg"
mutable = true
option {
name = "4 GB"
value = "4"
}
option {
name = "8 GB"
value = "8"
name = "Memory (__ GB)"
type = "number"
description = "Memory (__ GB) for your individual workspace"
icon = "https://www.vhv.rs/dpng/d/33-338595_random-access-memory-logo-hd-png-download.png"
validation {
min = 4
max = 16
}
form_type = "input"
mutable = true
default = 4
order = 2
}

data "coder_parameter" "home_disk_size" {
name = "home_disk_size"
display_name = "Home disk size"
description = "The size of the home disk in GB"
default = "20"
type = "number"
icon = "/emojis/1f4be.png"
mutable = false
name = "PVC storage size"
type = "number"
description = "Number of GB of storage for '${local.home_dir}'! This will persist after the workspace's K8s Pod is shutdown or deleted."
icon = "https://www.pngall.com/wp-content/uploads/5/Database-Storage-PNG-Clipart.png"
validation {
min = 1
max = 99999
min = 10
max = 50
monotonic = "increasing"
}
form_type = "slider"
mutable = true
default = 10
order = 3
}

data "coder_parameter" "ai_prompt" {
Expand All @@ -88,7 +112,7 @@ data "coder_workspace_owner" "me" {}
resource "coder_agent" "dev" {
arch = "amd64"
os = "linux"
dir = local.home_folder
dir = local.home_dir
startup_script = <<-EOT
set -e
sudo apt update
Expand Down Expand Up @@ -137,8 +161,8 @@ resource "coder_agent" "dev" {
CODER_MCP_CLAUDE_TASK_PROMPT = local.task_prompt
CODER_MCP_CLAUDE_SYSTEM_PROMPT = local.system_prompt
CLAUDE_CODE_USE_BEDROCK = "1"
ANTHROPIC_MODEL = "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
ANTHROPIC_SMALL_FAST_MODEL = "us.anthropic.claude-3-5-haiku-20241022-v1:0"
ANTHROPIC_MODEL = var.anthropic_model
ANTHROPIC_SMALL_FAST_MODEL = var.anthropic_small_fast_model
CODER_MCP_APP_STATUS_SLUG = "claude-code"
PGVECTOR_USER = "dbadmin"
PGVECTOR_PASSWORD = "YourStrongPasswordHere1"
Expand All @@ -156,7 +180,7 @@ resource "coder_agent" "dev" {

module "coder-login" {
source = "registry.coder.com/coder/coder-login/coder"
version = "1.0.15"
version = "1.1.0"
agent_id = coder_agent.dev.id
}

Expand All @@ -171,27 +195,28 @@ data "coder_parameter" "git_repo" {
module "git_clone" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/git-clone/coder"
version = "1.1.1"
version = "1.2.0"
agent_id = coder_agent.dev.id
url = data.coder_parameter.git_repo.value
}

# Create a code-server instance for the cloned repository
module "code-server" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/code-server/coder"
version = "1.0.18"
agent_id = coder_agent.dev.id
order = 1
folder = "/home/coder"
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/code-server/coder"
version = "1.3.1"
agent_id = coder_agent.dev.id
order = 1
folder = local.home_dir
subdomain = false
}

module "claude-code" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/claude-code/coder"
version = "2.2.0"
agent_id = coder_agent.dev.id
folder = local.home_folder
folder = local.home_dir
subdomain = false

install_claude_code = true
Expand All @@ -213,7 +238,7 @@ module "kiro" {
source = "registry.coder.com/coder/kiro/coder"
version = "1.1.0"
agent_id = coder_agent.dev.id
folder = "/home/coder"
folder = local.home_dir
}

resource "coder_app" "preview" {
Expand All @@ -235,8 +260,7 @@ resource "coder_app" "preview" {

locals {
cost = 2
region = "us-east-2"
home_folder = "/home/coder"
region = "us-west-2"
}

locals {
Expand Down Expand Up @@ -447,10 +471,11 @@ module "aurora-pgvector" {
db_master_username = "dbadmin"
db_master_password = "YourStrongPasswordHere1"
database_name = "mydb1"
postgresql_version = var.postgresql_version
}

resource "coder_metadata" "pod_info" {
count = data.coder_workspace.me.start_count
resource_id = kubernetes_deployment.dev[0].id
daily_cost = local.cost
}
}
Loading