

# CreateTenantDatabase
<a name="API_CreateTenantDatabase"></a>

Creates a tenant database in a DB instance that uses the multi-tenant configuration. Only RDS for Oracle container database (CDB) instances are supported.

## Request Parameters
<a name="API_CreateTenantDatabase_RequestParameters"></a>

 For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

 ** DBInstanceIdentifier **   
The user-supplied DB instance identifier. RDS creates your tenant database in this DB instance. This parameter isn't case-sensitive.  
Type: String  
Required: Yes

 ** MasterUsername **   
The name for the master user account in your tenant database. RDS creates this user account in the tenant database and grants privileges to the master user. This parameter is case-sensitive.  
Constraints:  
+ Must be 1 to 16 letters, numbers, or underscores.
+ First character must be a letter.
+ Can't be a reserved word for the chosen database engine.
Type: String  
Required: Yes

 ** TenantDBName **   
The user-supplied name of the tenant database that you want to create in your DB instance. This parameter has the same constraints as `DBName` in `CreateDBInstance`.  
Type: String  
Required: Yes

 ** CharacterSetName **   
The character set for your tenant database. If you don't specify a value, the character set name defaults to `AL32UTF8`.  
Type: String  
Required: No

 ** ManageMasterUserPassword **   
Specifies whether to manage the master user password with Amazon Secrets Manager.  
For more information, see [Password management with Amazon Secrets Manager](https://docs.amazonaws.cn/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User Guide.*   
Constraints:  
+ Can't manage the master user password with Amazon Secrets Manager if `MasterUserPassword` is specified.
Type: Boolean  
Required: No

 ** MasterUserPassword **   
The password for the master user in your tenant database.  
Constraints:  
+ Must be 8 to 30 characters.
+ Can include any printable ASCII character except forward slash (`/`), double quote (`"`), at symbol (`@`), ampersand (`&`), or single quote (`'`).
+ Can't be specified when `ManageMasterUserPassword` is enabled.
Type: String  
Required: No

 ** MasterUserSecretKmsKeyId **   
The Amazon KMS key identifier to encrypt a secret that is automatically generated and managed in Amazon Secrets Manager.  
This setting is valid only if the master user password is managed by RDS in Amazon Secrets Manager for the DB instance.  
The Amazon KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. To use a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN.  
If you don't specify `MasterUserSecretKmsKeyId`, then the `aws/secretsmanager` KMS key is used to encrypt the secret. If the secret is in a different Amazon Web Services account, then you can't use the `aws/secretsmanager` KMS key to encrypt the secret, and you must use a customer managed KMS key.  
There is a default KMS key for your Amazon Web Services account. Your Amazon Web Services account has a different default KMS key for each Amazon Web Services Region.  
Type: String  
Required: No

 ** NcharCharacterSetName **   
The `NCHAR` value for the tenant database.  
Type: String  
Required: No

 **Tags.Tag.N**   
A list of tags.  
For more information, see [Tagging Amazon RDS resources](https://docs.amazonaws.cn/AmazonRDS/latest/UserGuide/USER_Tagging.html) in the *Amazon RDS User Guide* or [Tagging Amazon Aurora and Amazon RDS resources](https://docs.amazonaws.cn/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html) in the *Amazon Aurora User Guide*.   
Type: Array of [Tag](API_Tag.md) objects  
Required: No

## Response Elements
<a name="API_CreateTenantDatabase_ResponseElements"></a>

The following element is returned by the service.

 ** TenantDatabase **   
A tenant database in the DB instance. This data type is an element in the response to the `DescribeTenantDatabases` action.  
Type: [TenantDatabase](API_TenantDatabase.md) object

## Errors
<a name="API_CreateTenantDatabase_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** DBInstanceNotFound **   
 `DBInstanceIdentifier` doesn't refer to an existing DB instance.  
HTTP Status Code: 404

 ** InvalidDBInstanceState **   
The DB instance isn't in a valid state.  
HTTP Status Code: 400

 ** KMSKeyNotAccessibleFault **   
An error occurred accessing an Amazon KMS key.  
HTTP Status Code: 400

 ** TenantDatabaseAlreadyExists **   
You attempted to either create a tenant database that already exists or modify a tenant database to use the name of an existing tenant database.  
HTTP Status Code: 400

 ** TenantDatabaseQuotaExceeded **   
You attempted to create more tenant databases than are permitted in your Amazon account.  
HTTP Status Code: 400

## See Also
<a name="API_CreateTenantDatabase_SeeAlso"></a>

For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/rds-2014-10-31/CreateTenantDatabase) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/rds-2014-10-31/CreateTenantDatabase) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/rds-2014-10-31/CreateTenantDatabase) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/rds-2014-10-31/CreateTenantDatabase) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/rds-2014-10-31/CreateTenantDatabase) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/rds-2014-10-31/CreateTenantDatabase) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/rds-2014-10-31/CreateTenantDatabase) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/rds-2014-10-31/CreateTenantDatabase) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/rds-2014-10-31/CreateTenantDatabase) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/rds-2014-10-31/CreateTenantDatabase) 