1

I am using terraform to create RDS instance

resource "aws_db_instance" "postgresql" {
  allocated_storage    = 10
  engine               = "postgres"
  engine_version       = "14.1"
  instance_class       = "db.t3.micro"
  username             = var.db_username
  password             = var.db_password
  publicly_accessible  = false
}

note that db_name attribute is not included so this configuration will not create any database

Is there anyway to create empty database using terraform in existing RDS instance?

1 Answer 1

1

Yes, you can use postgresql_database to create a database in your rds belonging to postgresql provider.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.