Giter Club home page Giter Club logo

terraform-azurerm-postgresql-read-replica's Introduction

terraform-azurerm-postgresql-read-replica

A module to manage Azure Database for PostgreSQL Read Replica until support for PostgreSQL read replicas is implemented. See issue terraform-provider-azurerm#2819 for more details.

Update: As of version 2.7.0, the Azure provider now supports the creation of replicas. I'll be reviewing what if any purpose this module will now play.

Limitations

  • The module is dependant on the Azure CLI
  • Changes outside of Terraform are not detected, and re-applying does not resolve this.
  • It's not yet possible to break replication and turn the replica into a primary server.
  • It's not yet possible to specify a different location, i.e. cross-region replication.
  • You cannot use this module to import an existing read replica.

Example

The following example creates a read replica in the same location as the primary, and adds a firewall rule to the read replica.

resource "azurerm_resource_group" "demo" {
  location = "uksouth"
  name     = "demo"
}

resource "azurerm_postgresql_server" "demo" {
  name                = "pr1mary-demo"
  location            = azurerm_resource_group.demo.location
  resource_group_name = azurerm_resource_group.demo.name
  ... # shortened for the sake of brevity, see the Azure provider documentation for more details
}

module demo-replica {
  source                         = "booyaa/terraform-azurerm-postgresql-read-replica"
  resource_group_name            = azurerm_resource_group.demo.name
  postgresql_primary_server_name = azurerm_postgresql_server.demo.name
  postgresql_replica_server_name = "${azurerm_postgresql_server.demo.name}-replica"
}

resource "azurerm_postgresql_firewall_rule" "demo-replica" {
  name                = "office"
  resource_group_name = azurerm_resource_group.demo.name
  server_name         = module.demo-replica.replica_name
  start_ip_address    = "8.8.8.8"
  end_ip_address      = "8.8.8.8"

  depends_on = [module.demo-replica]
}

Copyright

Mark Sta Ana © 2019

terraform-azurerm-postgresql-read-replica's People

Contributors

booyaa avatar

Stargazers

 avatar

Watchers

 avatar

terraform-azurerm-postgresql-read-replica's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.