What is the difference between DBInstanceIdentifier and DBName for rds.create_db_instance?

Viewed 2747

What is the difference between the parameters 'DBInstanceIdentifier' and 'DBName'?

For a mysql db, it seems to me they are essentially identical.

And since 'DBName' is optional, I can only just pass 'DBInstanceIdentifier' to rds.create_db_instance. Is it right?

In what situation do I need to provide both parameters? And in what situation their values have to be different from each other?

1 Answers

DBName does different things depending on the engine:

  • the name of a blank/empty schema that you want the service to automatically create inside your new instance (MySQL, Aurora/MySQL, and MariaDB, the default is not to create a schema; this option serves no real purpose unless for some reason you want one empty schema to be created automatically)
  • the name it will use instead of the default, to create a new database after launch (Postgres, default postgres is created otherwise)
  • the SID of the instance (Oracle, default ORCL)
  • a forbidden field (MSSQL).

In short, you typically won't set it to the same value as the instance identifier. Don't set it at all unless you have a reason to set it.

https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html

Related