terraform_aurora_postgresql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
terraform_aurora_postgresql [2023/09/10 15:03] andonovjterraform_aurora_postgresql [2023/09/10 15:05] (current) andonovj
Line 1: Line 1:
  
-=====Overview=====+======Overview======
 In this module, we will configure Aurora PostrgreSQL with one node (reader and writer). Furthermore, we will configure PostgreSQL pg_logical extension to replicate to another PostgreSQL RDS. In this module, we will configure Aurora PostrgreSQL with one node (reader and writer). Furthermore, we will configure PostgreSQL pg_logical extension to replicate to another PostgreSQL RDS.
 So let's get started. So let's get started.
  
  
-=====Configure the publisher / provider =====+====== Configure the publisher / provider ======
 Firstly, we will start with the creation of the Aurora PostgreSQL, which will acts as a Publisher / Provider Firstly, we will start with the creation of the Aurora PostgreSQL, which will acts as a Publisher / Provider
  
Line 370: Line 370:
  
  
-===== Configure the Subscriber =====+====== Configure the Subscriber ======
 The following code, will configure RDS PostgreSQL and it will create some Demo structure for the pg_logical: The following code, will configure RDS PostgreSQL and it will create some Demo structure for the pg_logical:
  
Line 611: Line 611:
 </Code> </Code>
  
 +Of course, that excludes all the meta configuration which you need to do for Terraform like: "provider.tf", "terraform.tfvars" and "variables.tf"
  
 +That being said, as we need the security rules (ports, etc), here is extract from vars:
 +
 +
 +<Code:bash|Variables>
 +variable "region" {
 +  description = "Defines AWS region"
 +  type        = string
 +  default     = "eu-central-1"
 +}
 +
 +variable "environment" {
 +  description = "Name of the environment"
 +  type        = string
 +}
 +
 +variable "database_admin_password" {
 +  description = "The password for the database"
 +  type        = string
 +
 +}
 +
 +variable "database_admin_username"{
 +  description = "The username for the database"
 +  type        = string
 +}
 +
 +variable "private_key_path" {
 +  description = "The path of the private key"
 +  type        = string
 +}
 +
 +variable "public_key" {
 +  description = "Public key for the session"
 +  type        = string  
 +}
 +
 +variable "ami" {
 +  description = "AMI for the EC2 image"
 +  type        = string
 +  default     = "ami-025d24108be0a614c"
 +}
 +
 +variable "destination_sql_path" {
 +  description = "The path for the configuration of the source cluster"
 +  type        = string
 +}
 +
 +variable "database_name" {
 +  description = "The name of the virtual database we will replicate"
 +  type        = string
 +}
 +
 +variable "source_endpoint" {
 +  description = "The endpoint of the source database, provided manually for now"
 +  type        = string
 +}
 +
 +
 +variable "rules" {
 +  type = list(object({
 +    from_port   = number
 +    to_port     = number
 +    protocol    = string
 +    description = string
 +  }))
 +  default = [
 +    {
 +      from_port   = 22
 +      to_port     = 22
 +      protocol    = "tcp"
 +      description = "ssh access"
 +    },
 +    {
 +      from_port   = 5432
 +      to_port     = 5432
 +      protocol    = "tcp"
 +      description = "postgresql access"
 +    },
 +  ]
 +}
 +</Code>
 +
 +The "terraform.tfvars" are of course customized.
  • terraform_aurora_postgresql.1694358214.txt.gz
  • Last modified: 2023/09/10 15:03
  • by andonovj