PureDevOps Community

Terraform manifest for aurora postgres and mysql serverles

For Mysql

resource "aws_rds_cluster" "default" {
  cluster_identifier      = "aurora-cluster-demo"
  engine                  = "aurora-mysql"  
  engine_mode             = "serverless"  
  database_name           = "myauroradb"  
  enable_http_endpoint    = true  
  master_username         = "root"
  master_password         = "mysqldb123"
  backup_retention_period = 1
  
  skip_final_snapshot     = true
  
  scaling_configuration {
    auto_pause               = true
    min_capacity             = 1    
    max_capacity             = 2
    seconds_until_auto_pause = 300
    timeout_action           = "ForceApplyCapacityChange"
  }  
}

For postgres

resource "aws_rds_cluster" "default" {
  cluster_identifier      = "aurora-cluster-demo-postgres"
  engine                  = "aurora-postgresql"  
  engine_mode             = "serverless"  
  database_name           = "myauroradb-postgress"  
  enable_http_endpoint    = true  
  master_username         = "root"
  master_password         = "postgres123"
  backup_retention_period = 1
  
  skip_final_snapshot     = true
  
  scaling_configuration {
    auto_pause               = true
    min_capacity             = 1    
    max_capacity             = 2
    seconds_until_auto_pause = 300
    timeout_action           = "ForceApplyCapacityChange"
  }  
}