forked from rciam/rciam-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bruce Becker <[email protected]>
- Loading branch information
1 parent
5e7473f
commit bb06133
Showing
4 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
resource "digitalocean_vpc" "rciam" { | ||
name = "rciam-${var.deployment_name}" | ||
region = var.region | ||
} | ||
|
||
resource "digitalocean_database_cluster" "rciam" { | ||
name = "rciam-db-${var.deployment_name}" | ||
engine = "pg" | ||
version = var.pg_version | ||
region = var.region | ||
node_count = 1 | ||
size = var.db_size | ||
} | ||
|
||
resource "digitalocean_database_user" "rciam" { | ||
name = var.db_user | ||
cluster_id = digitalocean_database_cluster.rciam.id | ||
} |
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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
terraform { | ||
required_version = "~> 1.7" | ||
|
||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = "~> 2.36" | ||
} | ||
} | ||
backend "local" {} | ||
} | ||
|
||
provider "digitalocean" {} |
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,29 @@ | ||
variable "deployment_name" { | ||
type = string | ||
description = "Name of the deployment of this instance" | ||
default = "default" | ||
} | ||
|
||
variable "region" { | ||
type = string | ||
description = "Name of the DigitalOcean region we are creating the VPC in" | ||
default = "ams3" | ||
} | ||
|
||
variable "pg_version" { | ||
type = string | ||
description = "Postgres version of managed DB" | ||
default = "11" | ||
} | ||
|
||
variable "db_size" { | ||
type = string | ||
description = "Instance size for PostgreSQL db." | ||
default = "db-s-1-vcpu-1gb" | ||
} | ||
|
||
variable "db_user" { | ||
type = string | ||
description = "Username to connect to DB" | ||
default = "postgres" | ||
} |