Skip to content

Commit

Permalink
Added aurora pgvector setups
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecosta90 committed Feb 15, 2024
1 parent 266640a commit 6005c80
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

################################################################################
# This is the bucket holding this specific setup tfstate
################################################################################
terraform {
backend "s3" {
bucket = "performance-cto-group"
region = "us-east-1"
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

module "cluster" {
source = "terraform-aws-modules/rds-aurora/aws"

name = "vector-benchmark-aurora-db-r6gd-2xlarge-postgres-16-1"
engine = "aurora-postgresql"
engine_version = "16.1"
instance_class = "db.r6gd.large"
instances = {
one = {
instance_class = "db.r6gd.2xlarge"
}
}
manage_master_user_password = false
master_password = "performance"
master_username = "postgres"

vpc_id = data.terraform_remote_state.shared_resources.outputs.performance_cto_vpc_id
db_subnet_group_name = "perf-cto-us-east-2-documentdb-subnetgroup"

security_group_rules = {
ex1_ingress = {
cidr_blocks = ["10.20.0.0/20"]
}
ex1_ingress = {
source_security_group_id = "${data.terraform_remote_state.shared_resources.outputs.performance_cto_sg_id}"
}
}

storage_encrypted = true
apply_immediately = true
monitoring_interval = 10
skip_final_snapshot = true


tags = {
"Name" = "vector-benchmark-aurora-db-r6gd-2xlarge-postgres-16-1"
Project = "Vector-Competitive-Aurora"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

output "primary_endpoint_address" {
sensitive = true
value = ["${module.cluster}"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# provider
provider "aws" {
region = var.region
}

################################################################################
# This is the shared resources bucket key -- you will need it across environments like security rules,etc...
# !! do not change this !!
################################################################################
data "terraform_remote_state" "shared_resources" {
backend = "s3"
config = {
bucket = "performance-cto-group"
key = "benchmarks/infrastructure/shared_resources.tfstate"
region = "us-east-1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


variable "region" {
default = "us-east-2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

################################################################################
# This is the bucket holding this specific setup tfstate
################################################################################
terraform {
backend "s3" {
bucket = "performance-cto-group"
region = "us-east-1"
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

module "cluster" {
source = "terraform-aws-modules/rds-aurora/aws"

name = "vector-benchmark-aurora-db-postgres-16-1"
engine = "aurora-postgresql"
engine_version = "16.1"
instance_class = "db.r7g.large"
instances = {
one = {
instance_class = "db.r7g.2xlarge"
}
}
manage_master_user_password = false
master_password = "performance"
master_username = "postgres"

vpc_id = data.terraform_remote_state.shared_resources.outputs.performance_cto_vpc_id
db_subnet_group_name = "perf-cto-us-east-2-documentdb-subnetgroup"

security_group_rules = {
ex1_ingress = {
cidr_blocks = ["10.20.0.0/20"]
}
ex1_ingress = {
source_security_group_id = "${data.terraform_remote_state.shared_resources.outputs.performance_cto_sg_id}"
}
}

storage_encrypted = true
apply_immediately = true
monitoring_interval = 10
skip_final_snapshot = true

# enabled_cloudwatch_logs_exports = ["postgresql"]

tags = {
"Name" = "vector-benchmark-aurora-db-postgres-16-1"
Project = "Vector-Competitive-Aurora"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

output "primary_endpoint_address" {
sensitive = true
value = ["${module.cluster}"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# provider
provider "aws" {
region = var.region
}

################################################################################
# This is the shared resources bucket key -- you will need it across environments like security rules,etc...
# !! do not change this !!
################################################################################
data "terraform_remote_state" "shared_resources" {
backend = "s3"
config = {
bucket = "performance-cto-group"
key = "benchmarks/infrastructure/shared_resources.tfstate"
region = "us-east-1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


variable "region" {
default = "us-east-2"
}

0 comments on commit 6005c80

Please sign in to comment.