Skip to main content

tenant_databases

Creates, updates, deletes, gets or lists a tenant_databases resource.

Overview

Nametenant_databases
TypeResource
Idaws.rds.tenant_databases

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
character_set_namestringThe character set of the tenant database.
db_instance_identifierstringThe ID of the DB instance that contains the tenant database.
dbi_resource_idstringThe Amazon Web Services Region-unique, immutable identifier for the DB instance.
deletion_protectionbooleanSpecifies whether deletion protection is enabled for the DB instance.
master_user_secretstringContains the secret managed by RDS in Amazon Web Services Secrets Manager for the master user password. For more information, see Password management with Amazon Web Services Secrets Manager in the Amazon RDS User Guide and Password management with Amazon Web Services Secrets Manager in the Amazon Aurora User Guide.
master_usernamestringThe master username of the tenant database.
nchar_character_set_namestringThe NCHAR character set name of the tenant database.
pending_modified_valuesstringInformation about pending changes for a tenant database.
statusstringThe status of the tenant database.
tag_liststringA list of tags. For more information, see Tagging Amazon RDS resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide.
tenant_db_namestringThe database name of the tenant database.
tenant_database_arnstringThe Amazon Resource Name (ARN) for the tenant database.
tenant_database_create_timestringThe creation time of the tenant database.
tenant_database_resource_idstringThe Amazon Web Services Region-unique, immutable identifier for the tenant database.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_tenant_databasesselectregionDBInstanceIdentifier, TenantDBName, Filters, Marker, MaxRecordsDescribes the tenant databases in a DB instance that uses the multi-tenant configuration. Only RDS for Oracle CDB instances are supported.
create_tenant_databaseinsertDBInstanceIdentifier, TenantDBName, MasterUsername, regionMasterUserPassword, CharacterSetName, NcharCharacterSetName, ManageMasterUserPassword, MasterUserSecretKmsKeyId, TagsCreates a tenant database in a DB instance that uses the multi-tenant configuration. Only RDS for Oracle container database (CDB) instances are supported.
modify_tenant_databaseupdateDBInstanceIdentifier, TenantDBName, regionMasterUserPassword, NewTenantDBName, ManageMasterUserPassword, RotateMasterUserPassword, MasterUserSecretKmsKeyIdModifies an existing tenant database in a DB instance. You can change the tenant database name or the master user password. This operation is supported only for RDS for Oracle CDB instances using the multi-tenant configuration.
delete_tenant_databasedeleteDBInstanceIdentifier, TenantDBName, regionSkipFinalSnapshot, FinalDBSnapshotIdentifierDeletes a tenant database from your DB instance. This command only applies to RDS for Oracle container database (CDB) instances. You can't delete a tenant database when it is the only tenant in the DB instance.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
DBInstanceIdentifierstringThe user-supplied identifier for the DB instance that contains the tenant database that you want to delete.
MasterUsernamestringThe 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.
TenantDBNamestringThe user-supplied name of the tenant database that you want to remove from your DB instance. Amazon RDS deletes the tenant database with this name. This parameter isn’t case-sensitive.
regionstringAWS region (default: us-east-1)
CharacterSetNamestringThe character set for your tenant database. If you don't specify a value, the character set name defaults to AL32UTF8.
DBInstanceIdentifierstringThe user-supplied DB instance identifier, which must match the identifier of an existing instance owned by the Amazon Web Services account. This parameter isn't case-sensitive.
FiltersarrayA filter that specifies one or more database tenants to describe. Supported filters: tenant-db-name - Tenant database names. The results list only includes information about the tenant databases that match these tenant DB names. tenant-database-resource-id - Tenant database resource identifiers. dbi-resource-id - DB instance resource identifiers. The results list only includes information about the tenants contained within the DB instances identified by these resource identifiers.
FinalDBSnapshotIdentifierstringThe DBSnapshotIdentifier of the new DBSnapshot created when the SkipFinalSnapshot parameter is disabled. If you enable this parameter and also enable SkipFinalShapshot, the command results in an error.
ManageMasterUserPasswordbooleanSpecifies whether to manage the master user password with Amazon Web Services Secrets Manager. If the tenant database doesn't manage the master user password with Amazon Web Services Secrets Manager, you can turn on this management. In this case, you can't specify MasterUserPassword. If the tenant database already manages the master user password with Amazon Web Services Secrets Manager, and you specify that the master user password is not managed with Amazon Web Services Secrets Manager, then you must specify MasterUserPassword. In this case, Amazon RDS deletes the secret and uses the new password for the master user specified by MasterUserPassword. For more information, see Password management with Amazon Web Services Secrets Manager in the Amazon RDS User Guide. Constraints: Can't manage the master user password with Amazon Web Services Secrets Manager if MasterUserPassword is specified.
MarkerstringAn optional pagination token provided by a previous DescribeTenantDatabases request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
MasterUserPasswordstringThe new password for the master user of the specified tenant database in your DB instance. Amazon RDS operations never return the password, so this action provides a way to regain access to a tenant database user if the password is lost. This includes restoring privileges that might have been accidentally revoked. Constraints: Can include any printable ASCII character except /, " (double quote), @, & (ampersand), and ' (single quote). Length constraints: Must contain between 8 and 30 characters.
MasterUserSecretKmsKeyIdstringThe Amazon Web Services KMS key identifier to encrypt a secret that is automatically generated and managed in Amazon Web Services Secrets Manager. This setting is valid only if both of the following conditions are met: The tenant database doesn't manage the master user password in Amazon Web Services Secrets Manager. If the tenant database already manages the master user password in Amazon Web Services Secrets Manager, you can't change the KMS key used to encrypt the secret. You're turning on ManageMasterUserPassword to manage the master user password in Amazon Web Services Secrets Manager. If you're turning on ManageMasterUserPassword and 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 self-managed KMS key. The Amazon Web Services KMS key identifier is any of the following: Key ARN Key ID Alias ARN 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. A default KMS key exists for your Amazon Web Services account. Your Amazon Web Services account has a different default KMS key for each Amazon Web Services Region.
MaxRecordsintegerThe maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a pagination token called a marker is included in the response so that you can retrieve the remaining results.
NcharCharacterSetNamestringThe NCHAR value for the tenant database.
NewTenantDBNamestringThe new name of the tenant database when renaming a tenant database. This parameter isn’t case-sensitive. Constraints: Can't be the string null or any other reserved word. Can't be longer than 8 characters.
RotateMasterUserPasswordbooleanSpecifies whether to rotate the secret managed by Amazon Web Services Secrets Manager for the master user password. This setting is valid only if the master user password is managed by RDS in Amazon Web Services Secrets Manager for the DB instance. The secret value contains the updated password. For more information, see Password management with Amazon Web Services Secrets Manager in the Amazon RDS User Guide. Constraints: You must apply the change immediately when rotating the master user password.
SkipFinalSnapshotbooleanSpecifies whether to skip the creation of a final DB snapshot before removing the tenant database from your DB instance. If you enable this parameter, RDS doesn't create a DB snapshot. If you don't enable this parameter, RDS creates a DB snapshot before it deletes the tenant database. By default, RDS doesn't skip the final snapshot. If you don't enable this parameter, you must specify the FinalDBSnapshotIdentifier parameter.
Tagsarray
TenantDBNamestringThe user-supplied tenant database name, which must match the name of an existing tenant database on the specified DB instance owned by your Amazon Web Services account. This parameter isn’t case-sensitive.

SELECT examples

Describes the tenant databases in a DB instance that uses the multi-tenant configuration. Only RDS for Oracle CDB instances are supported.

SELECT
character_set_name,
db_instance_identifier,
dbi_resource_id,
deletion_protection,
master_user_secret,
master_username,
nchar_character_set_name,
pending_modified_values,
status,
tag_list,
tenant_db_name,
tenant_database_arn,
tenant_database_create_time,
tenant_database_resource_id
FROM aws.rds.tenant_databases
WHERE region = '{{ region }}' -- required
AND DBInstanceIdentifier = '{{ DBInstanceIdentifier }}'
AND TenantDBName = '{{ TenantDBName }}'
AND Filters = '{{ Filters }}'
AND Marker = '{{ Marker }}'
AND MaxRecords = '{{ MaxRecords }}'
;

INSERT examples

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

INSERT INTO aws.rds.tenant_databases (
DBInstanceIdentifier,
TenantDBName,
MasterUsername,
region,
MasterUserPassword,
CharacterSetName,
NcharCharacterSetName,
ManageMasterUserPassword,
MasterUserSecretKmsKeyId,
Tags
)
SELECT
'{{ DBInstanceIdentifier }}',
'{{ TenantDBName }}',
'{{ MasterUsername }}',
'{{ region }}',
'{{ MasterUserPassword }}',
'{{ CharacterSetName }}',
'{{ NcharCharacterSetName }}',
'{{ ManageMasterUserPassword }}',
'{{ MasterUserSecretKmsKeyId }}',
'{{ Tags }}'
RETURNING
character_set_name,
db_instance_identifier,
dbi_resource_id,
deletion_protection,
master_user_secret,
master_username,
nchar_character_set_name,
pending_modified_values,
status,
tag_list,
tenant_db_name,
tenant_database_arn,
tenant_database_create_time,
tenant_database_resource_id
;

UPDATE examples

Modifies an existing tenant database in a DB instance. You can change the tenant database name or the master user password. This operation is supported only for RDS for Oracle CDB instances using the multi-tenant configuration.

UPDATE aws.rds.tenant_databases
SET
-- No updatable properties
WHERE
DBInstanceIdentifier = '{{ DBInstanceIdentifier }}' --required
AND TenantDBName = '{{ TenantDBName }}' --required
AND region = '{{ region }}' --required
AND MasterUserPassword = '{{ MasterUserPassword}}'
AND NewTenantDBName = '{{ NewTenantDBName}}'
AND ManageMasterUserPassword = {{ ManageMasterUserPassword}}
AND RotateMasterUserPassword = {{ RotateMasterUserPassword}}
AND MasterUserSecretKmsKeyId = '{{ MasterUserSecretKmsKeyId}}'
RETURNING
character_set_name,
db_instance_identifier,
dbi_resource_id,
deletion_protection,
master_user_secret,
master_username,
nchar_character_set_name,
pending_modified_values,
status,
tag_list,
tenant_db_name,
tenant_database_arn,
tenant_database_create_time,
tenant_database_resource_id;

DELETE examples

Deletes a tenant database from your DB instance. This command only applies to RDS for Oracle container database (CDB) instances. You can't delete a tenant database when it is the only tenant in the DB instance.

DELETE FROM aws.rds.tenant_databases
WHERE DBInstanceIdentifier = '{{ DBInstanceIdentifier }}' --required
AND TenantDBName = '{{ TenantDBName }}' --required
AND region = '{{ region }}' --required
AND SkipFinalSnapshot = '{{ SkipFinalSnapshot }}'
AND FinalDBSnapshotIdentifier = '{{ FinalDBSnapshotIdentifier }}'
;