Skip to content

Commit 9e13faf

Browse files
committed
add postgres_ai version
1 parent 2f2eea3 commit 9e13faf

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

terraform/aws/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,11 @@ resource "aws_instance" "main" {
164164
}
165165

166166
user_data = templatefile("${path.module}/user_data.sh", {
167-
grafana_password = var.grafana_password
168-
postgres_ai_api_key = var.postgres_ai_api_key
169-
enable_demo_db = var.enable_demo_db
170-
instances_yml = templatefile("${path.module}/instances.yml.tpl", {
167+
grafana_password = var.grafana_password
168+
postgres_ai_api_key = var.postgres_ai_api_key
169+
enable_demo_db = var.enable_demo_db
170+
postgres_ai_version = var.postgres_ai_version
171+
instances_yml = templatefile("${path.module}/instances.yml.tpl", {
171172
monitoring_instances = var.monitoring_instances
172173
enable_demo_db = var.enable_demo_db
173174
})

terraform/aws/terraform.tfvars.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
# OPTIONAL PARAMETERS
4646
# -------------------------
4747

48+
# postgres_ai version (optional, defaults to 'main')
49+
# postgres_ai_version = "0.9" # branch or specific tag like "0.9"
50+
4851
# PostgreSQL instances to monitor (optional, can be empty for initial setup)
4952
# monitoring_instances = [
5053
# {

terraform/aws/user_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ chown -R postgres_ai:postgres_ai /data
7878

7979
# Clone postgres_ai repository
8080
cd /home/postgres_ai
81-
sudo -u postgres_ai git clone https://gitlab.com/postgres-ai/postgres_ai.git
81+
sudo -u postgres_ai git clone --branch ${postgres_ai_version} https://gitlab.com/postgres-ai/postgres_ai.git
8282

8383
# Configure postgres_ai
8484
cd postgres_ai

terraform/aws/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,9 @@ variable "enable_demo_db" {
7979
default = false
8080
}
8181

82+
variable "postgres_ai_version" {
83+
description = "postgres_ai version (git tag or branch)"
84+
type = string
85+
default = "main"
86+
}
87+

0 commit comments

Comments
 (0)