8000 GitHub - opsd-io/terraform-module-digitalocean-postgresql at changing_variables
[go: up one dir, main page]

Skip to content

Terraform module for creating PostgreSQL cluster on the DigitalOcean cloud.

License

Notifications You must be signed in to change notification settings

opsd-io/terraform-module-digitalocean-postgresql

 
 

Repository files navigation

OPSd - the unique and effortless way of managing cloud infrastructure.

Meet OPSd. The unique and effortless way of managing cloud infrastructure.

terraform-module-template

Introduction

What does the module provide?

Usage

module "terraform-module-digitalocean-postgresql" {

  cluster_name            = "example-postgresql-cluster"
  engine                  = "pg"
  postgresql_version      = "11"
  node_size               = "db-s-1vcpu-1gb"
  region                  = "nyc1"
  node_count              = 1
  common_tags             = ["production"]
  database_users          = ["Admin", "Mark", "Robert"]
  firewall_rules          = ["192.168.0.1", "192.168.0.2", "192.168.0.8"]
  replica_enable          = true
  replica_node_size       = "db-s-1vcpu-1gb"
  replica_cluster_name    = "example-postgresql-replica-cluster"
  replica_region          = "nyc1"
  firewall_rules_replica  = ["172.168.0.1", "172.168.0.2", "172.168.0.8"]

}

IMPORTANT: Make sure not to pin to master because there may be breaking changes between releases.

Requirements

Name Version
terraform >= 1.5.5
digitalocean >= 2.34.1

Providers

Name Version
digitalocean >= 2.34.1

Modules

No modules.

Resources

Name Type
digitalocean_database_cluster.main resource
digitalocean_database_firewall.main resource
digitalocean_database_firewall.replica_fw resource
digitalocean_database_replica.main resource
digitalocean_database_user.main resource

Inputs

Name Description Type Default Required
cluster_name The name of the database cluster. string n/a yes
common_tags A list of tag names to be applied to the database cluster. set(string) [] no
database_users List of users. set(string) [] no
env_name Name of the environment, where database will be deploy. Env will be added to cluster name. string n/a yes
firewall_rules List of trusted sources associated with the cluster. set(string) [] no
node_count Number of postgresql nodes that will be created. number 1 no
node_size The postgresql node instance size. string "db-s-1vcpu-1gb" no
postgresql_version Engine version used by the cluster. number 16 no
region DigitalOcean region where the cluster will reside. string n/a yes
replica_cluster_name The name of the replica database cluster. string null no
replica_enable Flag to control the replica creation. bool false no
replica_firewall_rules List of trusted sources associated with the replica cluster. set(string) [] no
replica_node_size The postgresql replica node instance size. string "db-s-1vcpu-1gb" no
replica_region DigitalOcean replica region where the cluster will reside. string null no

Outputs

Name Description
firewall_id A unique identifier for the firewall.
main_default_database Name of the cluster's default database.
main_default_user Username for the cluster's default user.
main_default_user_password Password for the cluster's default user.
main_host Database cluster's hostname.
main_host_id The ID of the database cluster.
main_port Network port that the database cluster is listening on.
main_private_host Same as host, but only accessible from resources within the account and in the same region.
main_private_uri Same as uri, but only accessible from resources within the account and in the same region.
main_uri The full URI for connecting to the database cluster.
replica_id Replica ID.
replica_uuid Replica UUID.
user_ids A unique identifier for database users.

Examples of usage

Do you want to see how the module works? See all the usage examples.

Related modules

The list of related modules (if present).

Contributing

If you are interested in contributing to the project, see see our guide.

Support

If you have a problem with the module or want to propose a new feature, you can report it via the project's (Github) issue tracker.

If you want to discuss something in person, you can join our community on Slack.

License

Apache License 2.0

0