cloud-foundation-fabric/modules/__experimental_deprecated/alloydb-instance
Ludovico Magnocavallo 6941313c7d
Factories refactor (#1843)
* factories refactor doc

* Adds file schema and filesystem organization

* Update 20231106-factories.md

* move factories out of blueprints and create new factories  README

* align factory in billing-account module

* align factory in dataplex-datascan module

* align factory in billing-account module

* align factory in net-firewall-policy module

* align factory in dns-response-policy module

* align factory in net-vpc-firewall module

* align factory in net-vpc module

* align factory variable names in FAST

* remove decentralized firewall blueprint

* bump terraform version

* bump module versions

* update top-level READMEs

* move project factory to modules

* fix variable names and tests

* tfdoc

* remove changelog link

* add project factory to top-level README

* fix cludrun eventarc diff

* fix README

* fix cludrun eventarc diff

---------

Co-authored-by: Simone Ruffilli <sruffilli@google.com>
2024-02-26 10:16:52 +00:00
..
README.md Factories refactor (#1843) 2024-02-26 10:16:52 +00:00
main.tf Factories refactor (#1843) 2024-02-26 10:16:52 +00:00
outputs.tf Factories refactor (#1843) 2024-02-26 10:16:52 +00:00
variables.tf Factories refactor (#1843) 2024-02-26 10:16:52 +00:00
versions.tf Factories refactor (#1843) 2024-02-26 10:16:52 +00:00

README.md

AlloyDB cluster and instance with read replicas

This module manages the creation of AlloyDB cluster and configuration with/without automated backup policy, Primary node instance and Read Node Pools.

Simple example

This example shows how to create Alloydb cluster and instance with multiple read pools in GCP project.

module "alloydb" {
  source       = "./fabric/modules/alloydb-instance"
  project_id   = "myproject"
  cluster_id   = "alloydb-cluster-all"
  location     = "europe-west2"
  labels       = {}
  display_name = ""
  initial_user = {
    user     = "alloydb-cluster-full",
    password = "alloydb-cluster-password"
  }
  network_self_link = "projects/myproject/global/networks/default"

  automated_backup_policy = null

  primary_instance_config = {
    instance_id       = "primary-instance-1",
    instance_type     = "PRIMARY",
    machine_cpu_count = 2,
    database_flags    = {},
    display_name      = "alloydb-primary-instance"
  }
  read_pool_instance = [
    {
      instance_id       = "read-instance-1",
      display_name      = "read-instance-1",
      instance_type     = "READ_POOL",
      node_count        = 1,
      database_flags    = {},
      machine_cpu_count = 1
    },
    {
      instance_id       = "read-instance-2",
      display_name      = "read-instance-2",
      instance_type     = "READ_POOL",
      node_count        = 1,
      database_flags    = {},
      machine_cpu_count = 1
    }
  ]

}

# tftest skip

TODO

  • Add IAM support
  • support password in output

Variables

name description type required default
cluster_id The ID of the alloydb cluster. string
network_self_link Network ID where the AlloyDb cluster will be deployed. string
primary_instance_config Primary cluster configuration that supports read and write operations. object({…})
project_id The ID of the project in which to provision resources. string
automated_backup_policy The automated backup policy for this cluster. object({…}) null
display_name Human readable display name for the Alloy DB Cluster. string null
encryption_key_name The fully-qualified resource name of the KMS key for cluster encryption. string null
initial_user Alloy DB Cluster Initial User Credentials. object({…}) null
labels User-defined labels for the alloydb cluster. map(string) {}
location Location where AlloyDb cluster will be deployed. string "europe-west2"
network_name The network name of the project in which to provision resources. string "multiple-readpool"
read_pool_instance List of Read Pool Instances to be created. list(object({…})) []

Outputs

name description sensitive
cluster Cluster created.
cluster_id ID of the Alloy DB Cluster created.
primary_instance Primary instance created.
primary_instance_id ID of the primary instance created.
read_pool_instance_ids IDs of the read instances created.