tenant_databases
Creates, updates, deletes, gets or lists a tenant_databases resource.
Overview
| Name | tenant_databases |
| Type | Resource |
| Id | aws.rds.tenant_databases |
Fields
The following fields are returned by SELECT queries:
- describe_tenant_databases
| Name | Datatype | Description |
|---|---|---|
character_set_name | string | The character set of the tenant database. |
db_instance_identifier | string | The ID of the DB instance that contains the tenant database. |
dbi_resource_id | string | The Amazon Web Services Region-unique, immutable identifier for the DB instance. |
deletion_protection | boolean | Specifies whether deletion protection is enabled for the DB instance. |
master_user_secret | string | Contains 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_username | string | The master username of the tenant database. |
nchar_character_set_name | string | The NCHAR character set name of the tenant database. |
pending_modified_values | string | Information about pending changes for a tenant database. |
status | string | The status of the tenant database. |
tag_list | string | A 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_name | string | The database name of the tenant database. |
tenant_database_arn | string | The Amazon Resource Name (ARN) for the tenant database. |
tenant_database_create_time | string | The creation time of the tenant database. |
tenant_database_resource_id | string | The Amazon Web Services Region-unique, immutable identifier for the tenant database. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_tenant_databases | select | region | DBInstanceIdentifier, TenantDBName, Filters, Marker, MaxRecords | Describes the tenant databases in a DB instance that uses the multi-tenant configuration. Only RDS for Oracle CDB instances are supported. |
create_tenant_database | insert | DBInstanceIdentifier, TenantDBName, MasterUsername, region | MasterUserPassword, CharacterSetName, NcharCharacterSetName, ManageMasterUserPassword, MasterUserSecretKmsKeyId, Tags | Creates 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_database | update | DBInstanceIdentifier, TenantDBName, region | MasterUserPassword, NewTenantDBName, ManageMasterUserPassword, RotateMasterUserPassword, MasterUserSecretKmsKeyId | 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. |
delete_tenant_database | delete | DBInstanceIdentifier, TenantDBName, region | SkipFinalSnapshot, FinalDBSnapshotIdentifier | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
DBInstanceIdentifier | string | The user-supplied identifier for the DB instance that contains the tenant database that you want to delete. |
MasterUsername | string | 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. |
TenantDBName | string | The 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. |
region | string | AWS region (default: us-east-1) |
CharacterSetName | string | The character set for your tenant database. If you don't specify a value, the character set name defaults to AL32UTF8. |
DBInstanceIdentifier | string | The 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. |
Filters | array | A 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. |
FinalDBSnapshotIdentifier | string | The 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. |
ManageMasterUserPassword | boolean | Specifies 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. |
Marker | string | An 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. |
MasterUserPassword | string | The 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. |
MasterUserSecretKmsKeyId | string | The 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. |
MaxRecords | integer | The 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. |
NcharCharacterSetName | string | The NCHAR value for the tenant database. |
NewTenantDBName | string | The 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. |
RotateMasterUserPassword | boolean | Specifies 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. |
SkipFinalSnapshot | boolean | Specifies 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. |
Tags | array | |
TenantDBName | string | The 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
- describe_tenant_databases
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
- create_tenant_database
- Manifest
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
;
# Description fields are for documentation purposes
- name: tenant_databases
props:
- name: DBInstanceIdentifier
value: "{{ DBInstanceIdentifier }}"
description: Required parameter for the tenant_databases resource.
- name: TenantDBName
value: "{{ TenantDBName }}"
description: Required parameter for the tenant_databases resource.
- name: MasterUsername
value: "{{ MasterUsername }}"
description: Required parameter for the tenant_databases resource.
- name: region
value: "{{ region }}"
description: Required parameter for the tenant_databases resource.
- name: MasterUserPassword
value: "{{ MasterUserPassword }}"
description: 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.
description: 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.
- name: CharacterSetName
value: "{{ CharacterSetName }}"
description: The character set for your tenant database. If you don't specify a value, the character set name defaults to AL32UTF8.
description: The character set for your tenant database. If you don't specify a value, the character set name defaults to AL32UTF8.
- name: NcharCharacterSetName
value: "{{ NcharCharacterSetName }}"
description: The NCHAR value for the tenant database.
description: The NCHAR value for the tenant database.
- name: ManageMasterUserPassword
value: {{ ManageMasterUserPassword }}
description: Specifies whether to manage the master user password with Amazon Web Services Secrets Manager. 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.
description: Specifies whether to manage the master user password with Amazon Web Services Secrets Manager. 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.
- name: MasterUserSecretKmsKeyId
value: "{{ MasterUserSecretKmsKeyId }}"
description: The 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 the master user password is managed by RDS in Amazon Web Services Secrets Manager for the DB instance. The Amazon Web Services 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.
description: The 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 the master user password is managed by RDS in Amazon Web Services Secrets Manager for the DB instance. The Amazon Web Services 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.
- name: Tags
value: "{{ Tags }}"
UPDATE examples
- modify_tenant_database
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
- delete_tenant_database
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 }}'
;