-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to Postgres DB for UDMIF and other various fixes (#553)
- Loading branch information
1 parent
517729b
commit ebe5b20
Showing
129 changed files
with
7,386 additions
and
1,927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
resource "google_sql_database_instance" "main" { | ||
name = var.instance_name | ||
database_version = var.database_version | ||
region = var.region | ||
deletion_protection = var.deletion_protection | ||
|
||
settings { | ||
# Second-generation instance tiers are based on the machine | ||
# type. See argument reference below. | ||
tier = var.tier | ||
user_labels = { | ||
"environment" = var.environment | ||
} | ||
backup_configuration { | ||
location = "us" | ||
point_in_time_recovery_enabled = true | ||
enabled = true | ||
start_time = "00:00" | ||
} | ||
maintenance_window { | ||
day = 7 | ||
hour = 0 | ||
update_track = "stable" | ||
} | ||
} | ||
} | ||
|
||
resource "google_compute_network" "private_network" { | ||
name = "private-network" | ||
} | ||
|
||
resource "google_compute_global_address" "private_ip_address" { | ||
name = "private-ip-address" | ||
purpose = "VPC_PEERING" | ||
address_type = "INTERNAL" | ||
prefix_length = 16 | ||
network = google_compute_network.private_network.id | ||
} | ||
|
||
resource "google_service_networking_connection" "private_vpc_connection" { | ||
network = google_compute_network.private_network.id | ||
service = "servicenetworking.googleapis.com" | ||
reserved_peering_ranges = [google_compute_global_address.private_ip_address.name] | ||
} | ||
|
||
resource "google_sql_database" "database" { | ||
name = var.db_name | ||
instance = google_sql_database_instance.main.name | ||
} | ||
|
||
resource "google_sql_user" "users" { | ||
name = var.db_user | ||
instance = google_sql_database_instance.main.name | ||
password = var.password | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,4 @@ globalConfig.json | |
# environment variables | ||
.env | ||
|
||
# mongo output | ||
.mongodb | ||
|
||
/util/devices.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require('ts-node/register'); | ||
|
||
module.exports = { | ||
client: 'pg', | ||
connection: { | ||
host: process.env.POSTGRESQL_INSTANCE_HOST, | ||
port: parseInt(process.env.POSTGRESQL_PORT || ""), | ||
user: process.env.POSTGRESQL_USER, | ||
password: process.env.POSTGRESQL_PASSWORD, | ||
database: process.env.POSTGRESQL_DATABASE, | ||
}, | ||
migrations: { | ||
directory: './src/migrations' | ||
}, | ||
debug: true | ||
}; | ||
|
Oops, something went wrong.