Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Aurora Serverless database cluster with secret manager in Terraform

I've been reading this page: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster

The example there is mainly for the provisioned database, I'm new to the serverless database, is there an Terraform example to create a serverless Aurora database cluster (SQL db), using the secret stored in the secret manager?

Many thanks.

like image 925
wawawa Avatar asked Oct 30 '25 20:10

wawawa


1 Answers

The basic example of creating serveless aurora is:

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         = "chang333eme321"
  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"
  }  
}

I'm not sure what do you want to do with secret manager. Its not clear from your question, so I'm providing any example for it.

like image 151
Marcin Avatar answered Nov 01 '25 08:11

Marcin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!