AMAZON RDS → POSTGRESQL FLEX

Amazon RDS and Aurora to STACKIT PostgreSQL Flex

StackToIT turns Aurora and RDS PostgreSQL into STACKIT PostgreSQL Flex with its users and databases, sets the access list from the workloads that really call the database, and takes Aurora MySQL to STACKIT MariaDB.

Aurora PostgreSQL: user and database carried over

From the published AWS Retail Store run. Left: the AWS source exactly as AWS publishes it. Right: the resource blocks StackToIT wrote; the review comments above each block in the file are left out here.

AWS sourceterraform/lib/dependencies/orders_rds.tf
module "orders_rds" {
  source  = "terraform-aws-modules/rds-aurora/aws"
  version = "7.7.1"

  name           = "${var.environment_name}-orders"
  engine         = "aurora-postgresql"
  engine_version = "15.10"
  instance_class = "db.t3.medium"

  instances = {
    one = {}
  }

  vpc_id  = var.vpc_id
  subnets = var.subnet_ids

  allowed_security_groups = concat(var.allowed_security_group_ids, [var.orders_security_group_id])

  master_password        = random_string.orders_db_master.result
  create_random_password = false
  database_name          = "orders"
  storage_encrypted      = true
  apply_immediately      = true
  skip_final_snapshot    = true

  create_db_parameter_group = true
  db_parameter_group_name   = "${var.environment_name}-orders"
  db_parameter_group_family = "aurora-postgresql15"

  create_db_cluster_parameter_group = true
  db_cluster_parameter_group_name   = "${var.environment_name}-orders"
  db_cluster_parameter_group_family = "aurora-postgresql15"

  tags = var.tags
}
STACKIT Terraform by StackToITterraform/data.tf
resource "stackit_postgresflex_user" "dependencies_orders_rds_this" {
  project_id  = var.project_id
  instance_id = stackit_postgresflex_instance.dependencies_orders_rds_this.instance_id
  username    = "root"
  roles       = var.orders_rds_admin_roles
}

output "dependencies_orders_rds_this_admin_password" {
  description = "The password STACKIT generated for the master user created by stackit_postgresflex_user for module.dependencies.module.orders_rds.aws_rds_cluster.this. Sensitive: tofu output hides it from the plan, the state holds it in plain text."
  value       = stackit_postgresflex_user.dependencies_orders_rds_this.password
  sensitive   = true
}

resource "stackit_postgresflex_database" "dependencies_orders_rds_this_orders" {
  project_id  = var.project_id
  instance_id = stackit_postgresflex_instance.dependencies_orders_rds_this.instance_id
  name        = "orders"
  owner       = stackit_postgresflex_user.dependencies_orders_rds_this.username
}
  • Master user becomes a Flex user

    The STACKIT user starts with the login role, the least privilege, as a variable. You decide whether it needs createdb or createrole.

  • Password generated by STACKIT

    The source password is not copied. STACKIT generates it, and a sensitive output hands it to your clients before the cutover.

  • Database and owner

    The orders database is created on the instance, owned by the generated user.

  • Instance sized and versioned

    The instance keeps PostgreSQL 15 and gets a flavor of 2 vCPU and 4 GiB. Its full block is on the AWS Terraform page.

Aurora MySQL to STACKIT MariaDB

STACKIT has no MySQL service. StackToIT takes Aurora MySQL to MariaDB, the closest engine on STACKIT, and states that the application needs a compatibility test.

AWS sourceterraform/lib/dependencies/catalog_rds.tf
module "catalog_rds" {
  source  = "terraform-aws-modules/rds-aurora/aws"
  version = "7.7.1"

  name                        = "${var.environment_name}-catalog"
  engine                      = "aurora-mysql"
  engine_version              = "8.0"
  instance_class              = "db.t3.medium"
  allow_major_version_upgrade = true

  instances = {
    one = {}
  }

  vpc_id  = var.vpc_id
  subnets = var.subnet_ids

  allowed_security_groups = concat(var.allowed_security_group_ids, [var.catalog_security_group_id])

  master_password        = random_string.catalog_db_master.result
  create_random_password = false
  database_name          = "catalog"
  storage_encrypted      = true
  apply_immediately      = true
  skip_final_snapshot    = true

  create_db_parameter_group = true
  db_parameter_group_name   = "${var.environment_name}-catalog"
  db_parameter_group_family = "aurora-mysql8.0"

  create_db_cluster_parameter_group = true
  db_cluster_parameter_group_name   = "${var.environment_name}-catalog"
  db_cluster_parameter_group_family = "aurora-mysql8.0"

  tags = var.tags
}
STACKIT Terraform by StackToITterraform/data.tf
resource "stackit_mariadb_instance" "dependencies_catalog_rds_this" {
  project_id = var.project_id
  name       = "retail-store-ecs-catalog"
  version    = var.catalog_rds_version
  plan_name  = var.catalog_rds_plan_name
  parameters = {
    sgw_acl = join(",", coalescelist(var.catalog_rds_allowed_cidrs, stackit_ske_cluster.retail_app_ecs_cluster.egress_address_ranges))
  }
}

resource "stackit_mariadb_credential" "dependencies_catalog_rds_this" {
  project_id  = var.project_id
  instance_id = stackit_mariadb_instance.dependencies_catalog_rds_this.instance_id
}
  • Closest engine, stated plainly

    The class is Replatform, and the code asks for a compatibility test before the move.

  • Access from the workloads

    By default, the access list comes from the egress ranges of the SKE cluster that replaces the ECS services.

  • Backups run by STACKIT

    STACKIT MariaDB takes a backup every 4 hours and keeps it 14 days. The source’s 7-day retention is recorded for review.

  • Credential generated

    A STACKIT credential replaces the random master password and is exposed as a sensitive output.

What changes for the two Aurora clusters

Settings the run names as not carried for the PostgreSQL Flex and MariaDB targets of the published AWS Retail Store run.

Aurora settingOn STACKITWhat you do
Master passwordNot copied; STACKIT generates itHand the new credential to the application
Master user nameA Flex user on PostgreSQL; on MariaDB the credential takes no user name and STACKIT computes itClients get new credentials
Subnet groupNo attribute; the instance has the endpoint STACKIT assignsPoint the clients at the new endpoint
Maintenance window, upgrade policy, parameter groupsNo attribute in the pinned providerCheck the settings your application relies on after the move
Cluster membersNot separate resources; the flavor (single or replica) or the plan defines the nodesChoose the flavor or plan
Skipped final snapshotThe instance is deleted at once when Terraform destroys itExport the data first if it must survive the cutover

The run names 12 properties of the orders cluster and 16 of the catalog cluster as not carried.

Decisions before the pilot

Both clusters sit in wave 4 of the dependency order, after their subnet and security group.

  • How the data moves (Data Architect)

    The options per store are export and import with the engine’s clients, replication with the engine’s own replication, or a tool of your own. No method is chosen, and recovery point and downtime tolerance come from your application file, not from a default.

  • Size is a proposal (Platform Architect)

    The flavor of the PostgreSQL instance is derived from the size the source states. The source states the size of its own offer, not the load, so you confirm it or set another.

  • Public endpoint (Security Architect)

    An endpoint that is private in the source becomes public on STACKIT, guarded by the access list. The options are to accept it, to use the Network Area scope only, or to redesign the endpoint.

Proven on a real AWS estate

The AWS Retail Store Sample App, a public Terraform project from AWS, assessed by StackToIT and published in full, exactly as the run wrote it.

View Case Study
282
Terraform resource declarations analyzed
44
migration units identified
38
target units generated, from 52 considered
331
plan steps written

Questions database teams ask

Does StackToIT move the data?

No. StackToIT changes nothing in any cloud. It writes the target and an execution plan with the data movement steps, and your team runs them.

Is the database reachable from the internet?

A PostgreSQL Flex endpoint is reached through an access list. StackToIT fills it with the egress addresses of the cluster that runs the clients and records this as a decision to confirm.

Which PostgreSQL version does the target run?

In the published run, Aurora PostgreSQL 15 became a PostgreSQL Flex instance on version 15.

Sources

Your next move: STACKIT.

Tell us about your estate. We show you what StackToIT delivers for it: target architecture, Terraform artifacts and a structured migration plan.