Skip to content

Instantly share code, notes, and snippets.

@gowatana

gowatana/db.tf Secret

Last active August 20, 2023 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gowatana/d77cb33dc596d817f34f5a0b3092fb48 to your computer and use it in GitHub Desktop.
Save gowatana/d77cb33dc596d817f34f5a0b3092fb48 to your computer and use it in GitHub Desktop.
data "nutanix_ndb_cluster" "c1" {
cluster_name = "EraCluster"
}
data "nutanix_ndb_profile" "nw_profile_1" {
profile_type = "Network"
profile_name = "DEFAULT_OOB_POSTGRESQL_NETWORK"
}
data "nutanix_ndb_profile" "sw_profile_1" {
profile_type = "Software"
profile_name = "POSTGRES_10.4_OOB"
}
data "nutanix_ndb_profile" "compute_profile_1" {
profile_type = "Compute"
profile_name = "DEFAULT_OOB_SMALL_COMPUTE"
}
data "nutanix_ndb_profile" "db_profile_1" {
profile_type = "Database_Parameter"
profile_name = "DEFAULT_POSTGRES_PARAMS"
}
data "nutanix_ndb_sla" "sla1" {
sla_name = "DEFAULT_OOB_BRASS_SLA"
}
resource "nutanix_ndb_database" "postgres_1" {
databasetype = "postgres_database"
name = "pgsql-01"
description = "Managed by Terraform"
softwareprofileid = data.nutanix_ndb_profile.sw_profile_1.id
softwareprofileversionid = data.nutanix_ndb_profile.sw_profile_1.latest_version_id
computeprofileid = data.nutanix_ndb_profile.compute_profile_1.id
networkprofileid = data.nutanix_ndb_profile.nw_profile_1.id
dbparameterprofileid = data.nutanix_ndb_profile.db_profile_1.id
nxclusterid = data.nutanix_ndb_cluster.c1.id
sshpublickey = var.ssh_public_key
postgresql_info {
listener_port = 5432
database_size = 200
db_password = "nutanix/4u"
database_names = "pgsql1"
}
nodes {
vmname = "ndb-pgsql-sv-01"
networkprofileid = data.nutanix_ndb_profile.nw_profile_1.id
}
timemachineinfo {
name = "pgdb-01_TM"
slaid = data.nutanix_ndb_sla.sla1.id
schedule {
snapshottimeofday {
hours = 6
minutes = 0
seconds = 0
}
continuousschedule {
enabled = true
logbackupinterval = 30
snapshotsperday = 1
}
weeklyschedule {
enabled = true
dayofweek = "WEDNESDAY"
}
monthlyschedule {
enabled = true
dayofmonth = "24"
}
quartelyschedule {
enabled = true
startmonth = "JANUARY"
dayofmonth = 24
}
yearlyschedule {
enabled = false
dayofmonth = 31
month = "DECEMBER"
}
}
}
}
@gowatana
Copy link
Author

下記の投稿むけ。

NDB で PostgreSQL DB をプロビジョニングしてみる。(Terraform 編)
https://blog.ntnx.jp/entry/2023/07/30/235532

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment