Skip to content

Commit 834cda3

Browse files
update modules and Anthropic Models
1 parent daea9c9 commit 834cda3

File tree

2 files changed

+84
-53
lines changed

2 files changed

+84
-53
lines changed

templates/awshp-k8s-rag-with-claude-code/aws-aurora/aurora-pgvector.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ variable "db_master_password" {
2828
default = "YourStrongPasswordHere1" # Consider using AWS Secrets Manager for production
2929
}
3030

31+
variable "postgresql_version" {
32+
description = "PostgreSQL database version"
33+
type = string
34+
default = "16.8"
35+
}
36+
3137
# Get EKS cluster info
3238
data "aws_eks_cluster" "current" {
3339
name = var.eks_cluster_name # Add this variable
@@ -90,7 +96,7 @@ resource "aws_rds_cluster" "awsrag_aurora_postgres_1" {
9096
cluster_identifier = "${var.workspace_name}-pgvector01"
9197
engine = "aurora-postgresql"
9298
engine_mode = "provisioned"
93-
engine_version = "16.6"
99+
engine_version = var.postgresql_version
94100
database_name = var.database_name
95101
master_username = var.db_master_username
96102
master_password = var.db_master_password # Use AWS Secrets Manager in production
@@ -109,7 +115,7 @@ resource "aws_rds_cluster_instance" "awsrag_aurora_primary" {
109115
cluster_identifier = aws_rds_cluster.awsrag_aurora_postgres_1.id
110116
instance_class = "db.serverless"
111117
engine = "aurora-postgresql"
112-
engine_version = "16.6"
118+
engine_version = var.postgresql_version
113119
db_subnet_group_name = aws_db_subnet_group.awsrag_aurora_subnet_group.name
114120
identifier = "${var.workspace_name}-primary"
115121
}

templates/awshp-k8s-rag-with-claude-code/main.tf

Lines changed: 76 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,59 +18,83 @@ terraform {
1818
variable "eks_cluster_name" {
1919
type = string
2020
description = "The AWS EKS Kubernetes cluster name that Coder is deployed within."
21+
default = "coder-eks-cluster"
2122
}
2223

2324
variable "namespace" {
2425
type = string
2526
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."
27+
default = "coder"
2628
}
2729

30+
variable "anthropic_model" {
31+
type = string
32+
description = "The AWS Inference profile ID of the base Anthropic model to use with Claude Code"
33+
default = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
34+
}
35+
36+
variable "anthropic_small_fast_model" {
37+
type = string
38+
description = "The AWS Inference profile ID of the small fast Anthropic model to use with Claude Code"
39+
default = "global.anthropic.claude-haiku-4-5-20251001-v1:0"
40+
}
41+
42+
variable "postgresql_version" {
43+
type = string
44+
description = "The AWS Aurora PostgreSQL Database Engine Version to deploy"
45+
default = "16.8"
46+
}
47+
48+
locals {
49+
home_dir = "/home/coder"
50+
}
51+
52+
# Minimum vCPUs needed
2853
data "coder_parameter" "cpu" {
29-
name = "cpu"
30-
display_name = "CPU"
31-
description = "The number of CPU cores"
32-
default = "2"
33-
icon = "/icon/memory.svg"
34-
mutable = true
35-
option {
36-
name = "2 Cores"
37-
value = "2"
38-
}
39-
option {
40-
name = "4 Cores"
41-
value = "4"
54+
name = "CPU cores"
55+
type = "number"
56+
description = "CPU cores for your individual workspace"
57+
icon = "https://png.pngtree.com/png-clipart/20191122/original/pngtree-processor-icon-png-image_5165793.jpg"
58+
validation {
59+
min = 4
60+
max = 8
4261
}
62+
form_type = "input"
63+
mutable = true
64+
default = 4
65+
order = 1
4366
}
4467

68+
# Minimum GB memory needed
4569
data "coder_parameter" "memory" {
46-
name = "memory"
47-
display_name = "Memory"
48-
description = "The amount of memory in GB"
49-
default = "4"
50-
icon = "/icon/memory.svg"
51-
mutable = true
52-
option {
53-
name = "4 GB"
54-
value = "4"
55-
}
56-
option {
57-
name = "8 GB"
58-
value = "8"
70+
name = "Memory (__ GB)"
71+
type = "number"
72+
description = "Memory (__ GB) for your individual workspace"
73+
icon = "https://www.vhv.rs/dpng/d/33-338595_random-access-memory-logo-hd-png-download.png"
74+
validation {
75+
min = 4
76+
max = 16
5977
}
78+
form_type = "input"
79+
mutable = true
80+
default = 4
81+
order = 2
6082
}
6183

6284
data "coder_parameter" "home_disk_size" {
63-
name = "home_disk_size"
64-
display_name = "Home disk size"
65-
description = "The size of the home disk in GB"
66-
default = "20"
67-
type = "number"
68-
icon = "/emojis/1f4be.png"
69-
mutable = false
85+
name = "PVC storage size"
86+
type = "number"
87+
description = "Number of GB of storage for '${local.home_dir}'! This will persist after the workspace's K8s Pod is shutdown or deleted."
88+
icon = "https://www.pngall.com/wp-content/uploads/5/Database-Storage-PNG-Clipart.png"
7089
validation {
71-
min = 1
72-
max = 99999
90+
min = 10
91+
max = 50
92+
monotonic = "increasing"
7393
}
94+
form_type = "slider"
95+
mutable = true
96+
default = 10
97+
order = 3
7498
}
7599

76100
data "coder_parameter" "ai_prompt" {
@@ -88,7 +112,7 @@ data "coder_workspace_owner" "me" {}
88112
resource "coder_agent" "dev" {
89113
arch = "amd64"
90114
os = "linux"
91-
dir = local.home_folder
115+
dir = local.home_dir
92116
startup_script = <<-EOT
93117
set -e
94118
sudo apt update
@@ -137,8 +161,8 @@ resource "coder_agent" "dev" {
137161
CODER_MCP_CLAUDE_TASK_PROMPT = local.task_prompt
138162
CODER_MCP_CLAUDE_SYSTEM_PROMPT = local.system_prompt
139163
CLAUDE_CODE_USE_BEDROCK = "1"
140-
ANTHROPIC_MODEL = "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
141-
ANTHROPIC_SMALL_FAST_MODEL = "us.anthropic.claude-3-5-haiku-20241022-v1:0"
164+
ANTHROPIC_MODEL = var.anthropic_model
165+
ANTHROPIC_SMALL_FAST_MODEL = var.anthropic_small_fast_model
142166
CODER_MCP_APP_STATUS_SLUG = "claude-code"
143167
PGVECTOR_USER = "dbadmin"
144168
PGVECTOR_PASSWORD = "YourStrongPasswordHere1"
@@ -156,7 +180,7 @@ resource "coder_agent" "dev" {
156180

157181
module "coder-login" {
158182
source = "registry.coder.com/coder/coder-login/coder"
159-
version = "1.0.15"
183+
version = "1.1.0"
160184
agent_id = coder_agent.dev.id
161185
}
162186

@@ -171,27 +195,28 @@ data "coder_parameter" "git_repo" {
171195
module "git_clone" {
172196
count = data.coder_workspace.me.start_count
173197
source = "registry.coder.com/coder/git-clone/coder"
174-
version = "1.1.1"
198+
version = "1.2.0"
175199
agent_id = coder_agent.dev.id
176200
url = data.coder_parameter.git_repo.value
177201
}
178202

179203
# Create a code-server instance for the cloned repository
180204
module "code-server" {
181-
count = data.coder_workspace.me.start_count
182-
source = "registry.coder.com/coder/code-server/coder"
183-
version = "1.0.18"
184-
agent_id = coder_agent.dev.id
185-
order = 1
186-
folder = "/home/coder"
205+
count = data.coder_workspace.me.start_count
206+
source = "registry.coder.com/coder/code-server/coder"
207+
version = "1.3.1"
208+
agent_id = coder_agent.dev.id
209+
order = 1
210+
folder = local.home_dir
211+
subdomain = false
187212
}
188213

189214
module "claude-code" {
190215
count = data.coder_workspace.me.start_count
191216
source = "registry.coder.com/coder/claude-code/coder"
192217
version = "2.2.0"
193218
agent_id = coder_agent.dev.id
194-
folder = local.home_folder
219+
folder = local.home_dir
195220
subdomain = false
196221

197222
install_claude_code = true
@@ -213,7 +238,7 @@ module "kiro" {
213238
source = "registry.coder.com/coder/kiro/coder"
214239
version = "1.1.0"
215240
agent_id = coder_agent.dev.id
216-
folder = "/home/coder"
241+
folder = local.home_dir
217242
}
218243

219244
resource "coder_app" "preview" {
@@ -235,8 +260,7 @@ resource "coder_app" "preview" {
235260

236261
locals {
237262
cost = 2
238-
region = "us-east-2"
239-
home_folder = "/home/coder"
263+
region = "us-west-2"
240264
}
241265

242266
locals {
@@ -447,10 +471,11 @@ module "aurora-pgvector" {
447471
db_master_username = "dbadmin"
448472
db_master_password = "YourStrongPasswordHere1"
449473
database_name = "mydb1"
474+
postgresql_version = var.postgresql_version
450475
}
451476

452477
resource "coder_metadata" "pod_info" {
453478
count = data.coder_workspace.me.start_count
454479
resource_id = kubernetes_deployment.dev[0].id
455480
daily_cost = local.cost
456-
}
481+
}

0 commit comments

Comments
 (0)