Skip to main content

db_clusters

Creates, updates, deletes or gets a db_cluster resource or lists db_clusters in a region

Overview

Namedb_clusters
TypeResource
DescriptionThe AWS::RDS::DBCluster resource creates an Amazon Aurora DB cluster.
Idaws.rds.db_clusters

Fields

NameDatatypeDescription
storage_encryptedbooleanIndicates whether the DB instance is encrypted.
If you specify the DBClusterIdentifier, SnapshotIdentifier, or SourceDBInstanceIdentifier property, don't specify this property. The value is inherited from the cluster, snapshot, or source DB instance.
db_system_idstringReserved for future use.
restore_to_timestringThe date and time to restore the DB cluster to. Value must be a time in Universal Coordinated Time (UTC) format. An example: 2015-03-07T23:45:00Z
engine_modestringThe DB engine mode of the DB cluster, either provisioned, serverless, parallelquery, global, or multimaster.
portintegerThe port number on which the instances in the DB cluster accept connections. Default: 3306 if engine is set as aurora or 5432 if set to aurora-postgresql.
db_cluster_identifierstringThe DB cluster identifier. This parameter is stored as a lowercase string.
storage_throughputintegerSpecifies the storage throughput value for the DB cluster. This setting applies only to the gp3 storage type.
monitoring_intervalintegerThe interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB cluster. To turn off collecting Enhanced Monitoring metrics, specify 0. The default is 0.
endpointobjectThis data type represents the information you need to connect to an Amazon RDS DB instance. This data type is used as a response element in the following actions:
+ CreateDBInstance
+ DescribeDBInstances
+ DeleteDBInstance

For the data structure that represents Amazon Aurora DB cluster endpoints, see DBClusterEndpoint.
replication_source_identifierstringThe Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a Read Replica.
enginestringThe name of the database engine to be used for this DB cluster. Valid Values: aurora (for MySQL 5.6-compatible Aurora), aurora-mysql (for MySQL 5.7-compatible Aurora), and aurora-postgresql
tagsarrayAn array of key-value pairs to apply to this resource.
engine_versionstringThe version number of the database engine to use.
storage_typestringSpecifies the storage type to be associated with the DB cluster.
kms_key_idstringThe Amazon Resource Name (ARN) of the AWS Key Management Service master key that is used to encrypt the database instances in the DB cluster, such as arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. If you enable the StorageEncrypted property but don't specify this property, the default master key is used. If you specify this property, you must set the StorageEncrypted property to true.
serverless_v2_scaling_configurationobjectContains the scaling configuration of an Aurora Serverless v2 DB cluster.
performance_insights_retention_periodintegerThe amount of time, in days, to retain Performance Insights data.
database_namestringThe name of your database. If you don't provide a name, then Amazon RDS won't create a database in this DB cluster. For naming constraints, see Naming Constraints in the Amazon RDS User Guide.
db_cluster_resource_idstringThe AWS Region-unique, immutable identifier for the DB cluster.
auto_minor_version_upgradebooleanA value that indicates whether minor engine upgrades are applied automatically to the DB cluster during the maintenance window. By default, minor engine upgrades are applied automatically.
db_subnet_group_namestringA DB subnet group that you want to associate with this DB cluster.
deletion_protectionbooleanA value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.
allocated_storageintegerThe amount of storage in gibibytes (GiB) to allocate to each DB instance in the Multi-AZ DB cluster.
master_user_passwordstringThe master password for the DB instance.
master_user_secretobjectContains the secret managed by RDS in AWS Secrets Manager for the master user password.
source_db_cluster_identifierstringThe identifier of the source DB cluster from which to restore.
master_usernamestringThe name of the master user for the DB cluster. You must specify MasterUsername, unless you specify SnapshotIdentifier. In that case, don't specify MasterUsername.
scaling_configurationobjectThe ScalingConfiguration property type specifies the scaling configuration of an Aurora Serverless DB cluster.
read_endpointobject
performance_insights_kms_key_idstringThe Amazon Web Services KMS key identifier for encryption of Performance Insights data.
publicly_accessiblebooleanA value that indicates whether the DB cluster is publicly accessible.
domainstringThe Active Directory directory ID to create the DB cluster in.
backtrack_windowintegerThe target backtrack window, in seconds. To disable backtracking, set this value to 0.
db_instance_parameter_group_namestringThe name of the DB parameter group to apply to all instances of the DB cluster.
enable_global_write_forwardingbooleanSpecifies whether to enable this DB cluster to forward write operations to the primary cluster of a global cluster (Aurora global database). By default, write operations are not allowed on Aurora DB clusters that are secondary clusters in an Aurora global database.
monitoring_role_arnstringThe Amazon Resource Name (ARN) for the IAM role that permits RDS to send Enhanced Monitoring metrics to Amazon CloudWatch Logs.
associated_rolesarrayProvides a list of the AWS Identity and Access Management (IAM) roles that are associated with the DB cluster. IAM roles that are associated with a DB cluster grant permission for the DB cluster to access other AWS services on your behalf.
enable_http_endpointbooleanA value that indicates whether to enable the HTTP endpoint for DB cluster. By default, the HTTP endpoint is disabled.
snapshot_identifierstringThe identifier for the DB snapshot or DB cluster snapshot to restore from.
You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you can use only the ARN to specify a DB snapshot.
After you restore a DB cluster with a SnapshotIdentifier property, you must specify the same SnapshotIdentifier property for any future updates to the DB cluster. When you specify this property for an update, the DB cluster is not restored from the snapshot again, and the data in the database is not changed. However, if you don't specify the SnapshotIdentifier property, an empty DB cluster is created, and the original DB cluster is deleted. If you specify a property that is different from the previous snapshot restore property, the DB cluster is restored from the specified SnapshotIdentifier property, and the original DB cluster is deleted.
preferred_backup_windowstringThe daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter. The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see Adjusting the Preferred DB Cluster Maintenance Window in the Amazon Aurora User Guide.
network_typestringThe network type of the DB cluster.
vpc_security_group_idsarrayA list of EC2 VPC security groups to associate with this DB cluster.
copy_tags_to_snapshotbooleanA value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The default is not to copy them.
global_cluster_identifierstringIf you are configuring an Aurora global database cluster and want your Aurora DB cluster to be a secondary member in the global database cluster, specify the global cluster ID of the global database cluster. To define the primary database cluster of the global cluster, use the AWS::RDS::GlobalCluster resource.
If you aren't configuring a global database cluster, don't specify this property.
restore_typestringThe type of restore to be performed. You can specify one of the following values:
full-copy - The new DB cluster is restored as a full copy of the source DB cluster.
copy-on-write - The new DB cluster is restored as a clone of the source DB cluster.
domain_iam_role_namestringSpecify the name of the IAM role to be used when making API calls to the Directory Service.
db_cluster_instance_classstringThe compute and memory capacity of each DB instance in the Multi-AZ DB cluster, for example db.m6g.xlarge.
availability_zonesarrayA list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on AWS Regions and Availability Zones, see Choosing the Regions and Availability Zones in the Amazon Aurora User Guide.
db_cluster_arnstringThe Amazon Resource Name (ARN) for the DB cluster.
preferred_maintenance_windowstringThe weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week. To see the time blocks available, see Adjusting the Preferred DB Cluster Maintenance Window in the Amazon Aurora User Guide.
iopsintegerThe amount of Provisioned IOPS (input/output operations per second) to be initially allocated for each DB instance in the Multi-AZ DB cluster.
source_regionstringThe AWS Region which contains the source DB cluster when replicating a DB cluster. For example, us-east-1.
use_latest_restorable_timebooleanA value that indicates whether to restore the DB cluster to the latest restorable backup time. By default, the DB cluster is not restored to the latest restorable backup time.
manage_master_user_passwordbooleanA value that indicates whether to manage the master user password with AWS Secrets Manager.
enable_iam_database_authenticationbooleanA value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. By default, mapping is disabled.
db_cluster_parameter_group_namestringThe name of the DB cluster parameter group to associate with this DB cluster.
performance_insights_enabledbooleanA value that indicates whether to turn on Performance Insights for the DB cluster.
backup_retention_periodintegerThe number of days for which automated backups are retained.
enable_cloudwatch_logs_exportsarrayThe list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list depend on the DB engine being used. For more information, see Publishing Database Logs to Amazon CloudWatch Logs in the Amazon Aurora User Guide.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all db_clusters in a region.

SELECT
region,
storage_encrypted,
db_system_id,
restore_to_time,
engine_mode,
port,
db_cluster_identifier,
storage_throughput,
monitoring_interval,
endpoint,
replication_source_identifier,
engine,
tags,
engine_version,
storage_type,
kms_key_id,
serverless_v2_scaling_configuration,
performance_insights_retention_period,
database_name,
db_cluster_resource_id,
auto_minor_version_upgrade,
db_subnet_group_name,
deletion_protection,
allocated_storage,
master_user_password,
master_user_secret,
source_db_cluster_identifier,
master_username,
scaling_configuration,
read_endpoint,
performance_insights_kms_key_id,
publicly_accessible,
domain,
backtrack_window,
db_instance_parameter_group_name,
enable_global_write_forwarding,
monitoring_role_arn,
associated_roles,
enable_http_endpoint,
snapshot_identifier,
preferred_backup_window,
network_type,
vpc_security_group_ids,
copy_tags_to_snapshot,
global_cluster_identifier,
restore_type,
domain_iam_role_name,
db_cluster_instance_class,
availability_zones,
db_cluster_arn,
preferred_maintenance_window,
iops,
source_region,
use_latest_restorable_time,
manage_master_user_password,
enable_iam_database_authentication,
db_cluster_parameter_group_name,
performance_insights_enabled,
backup_retention_period,
enable_cloudwatch_logs_exports
FROM aws.rds.db_clusters
WHERE region = 'us-east-1';

Gets all properties from an individual db_cluster.

SELECT
region,
storage_encrypted,
db_system_id,
restore_to_time,
engine_mode,
port,
db_cluster_identifier,
storage_throughput,
monitoring_interval,
endpoint,
replication_source_identifier,
engine,
tags,
engine_version,
storage_type,
kms_key_id,
serverless_v2_scaling_configuration,
performance_insights_retention_period,
database_name,
db_cluster_resource_id,
auto_minor_version_upgrade,
db_subnet_group_name,
deletion_protection,
allocated_storage,
master_user_password,
master_user_secret,
source_db_cluster_identifier,
master_username,
scaling_configuration,
read_endpoint,
performance_insights_kms_key_id,
publicly_accessible,
domain,
backtrack_window,
db_instance_parameter_group_name,
enable_global_write_forwarding,
monitoring_role_arn,
associated_roles,
enable_http_endpoint,
snapshot_identifier,
preferred_backup_window,
network_type,
vpc_security_group_ids,
copy_tags_to_snapshot,
global_cluster_identifier,
restore_type,
domain_iam_role_name,
db_cluster_instance_class,
availability_zones,
db_cluster_arn,
preferred_maintenance_window,
iops,
source_region,
use_latest_restorable_time,
manage_master_user_password,
enable_iam_database_authentication,
db_cluster_parameter_group_name,
performance_insights_enabled,
backup_retention_period,
enable_cloudwatch_logs_exports
FROM aws.rds.db_clusters
WHERE region = 'us-east-1' AND data__Identifier = '<DBClusterIdentifier>';

INSERT example

Use the following StackQL query and manifest file to create a new db_cluster resource, using stack-deploy.

/*+ create */
INSERT INTO aws.rds.db_clusters (
StorageEncrypted,
DBSystemId,
RestoreToTime,
EngineMode,
Port,
DBClusterIdentifier,
MonitoringInterval,
ReplicationSourceIdentifier,
Engine,
Tags,
EngineVersion,
StorageType,
KmsKeyId,
ServerlessV2ScalingConfiguration,
PerformanceInsightsRetentionPeriod,
DatabaseName,
AutoMinorVersionUpgrade,
DBSubnetGroupName,
DeletionProtection,
AllocatedStorage,
MasterUserPassword,
MasterUserSecret,
SourceDBClusterIdentifier,
MasterUsername,
ScalingConfiguration,
ReadEndpoint,
PerformanceInsightsKmsKeyId,
PubliclyAccessible,
Domain,
BacktrackWindow,
DBInstanceParameterGroupName,
EnableGlobalWriteForwarding,
MonitoringRoleArn,
AssociatedRoles,
EnableHttpEndpoint,
SnapshotIdentifier,
PreferredBackupWindow,
NetworkType,
VpcSecurityGroupIds,
CopyTagsToSnapshot,
GlobalClusterIdentifier,
RestoreType,
DomainIAMRoleName,
DBClusterInstanceClass,
AvailabilityZones,
PreferredMaintenanceWindow,
Iops,
SourceRegion,
UseLatestRestorableTime,
ManageMasterUserPassword,
EnableIAMDatabaseAuthentication,
DBClusterParameterGroupName,
PerformanceInsightsEnabled,
BackupRetentionPeriod,
EnableCloudwatchLogsExports,
region
)
SELECT
'{{ StorageEncrypted }}',
'{{ DBSystemId }}',
'{{ RestoreToTime }}',
'{{ EngineMode }}',
'{{ Port }}',
'{{ DBClusterIdentifier }}',
'{{ MonitoringInterval }}',
'{{ ReplicationSourceIdentifier }}',
'{{ Engine }}',
'{{ Tags }}',
'{{ EngineVersion }}',
'{{ StorageType }}',
'{{ KmsKeyId }}',
'{{ ServerlessV2ScalingConfiguration }}',
'{{ PerformanceInsightsRetentionPeriod }}',
'{{ DatabaseName }}',
'{{ AutoMinorVersionUpgrade }}',
'{{ DBSubnetGroupName }}',
'{{ DeletionProtection }}',
'{{ AllocatedStorage }}',
'{{ MasterUserPassword }}',
'{{ MasterUserSecret }}',
'{{ SourceDBClusterIdentifier }}',
'{{ MasterUsername }}',
'{{ ScalingConfiguration }}',
'{{ ReadEndpoint }}',
'{{ PerformanceInsightsKmsKeyId }}',
'{{ PubliclyAccessible }}',
'{{ Domain }}',
'{{ BacktrackWindow }}',
'{{ DBInstanceParameterGroupName }}',
'{{ EnableGlobalWriteForwarding }}',
'{{ MonitoringRoleArn }}',
'{{ AssociatedRoles }}',
'{{ EnableHttpEndpoint }}',
'{{ SnapshotIdentifier }}',
'{{ PreferredBackupWindow }}',
'{{ NetworkType }}',
'{{ VpcSecurityGroupIds }}',
'{{ CopyTagsToSnapshot }}',
'{{ GlobalClusterIdentifier }}',
'{{ RestoreType }}',
'{{ DomainIAMRoleName }}',
'{{ DBClusterInstanceClass }}',
'{{ AvailabilityZones }}',
'{{ PreferredMaintenanceWindow }}',
'{{ Iops }}',
'{{ SourceRegion }}',
'{{ UseLatestRestorableTime }}',
'{{ ManageMasterUserPassword }}',
'{{ EnableIAMDatabaseAuthentication }}',
'{{ DBClusterParameterGroupName }}',
'{{ PerformanceInsightsEnabled }}',
'{{ BackupRetentionPeriod }}',
'{{ EnableCloudwatchLogsExports }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.rds.db_clusters
WHERE data__Identifier = '<DBClusterIdentifier>'
AND region = 'us-east-1';

Permissions

To operate on the db_clusters resource, the following permissions are required:

Read

rds:DescribeDBClusters

Create

iam:CreateServiceLinkedRole,
iam:PassRole,
rds:AddRoleToDBCluster,
rds:AddTagsToResource,
rds:CreateDBCluster,
rds:CreateDBInstance,
rds:DescribeDBClusters,
rds:DescribeEvents,
rds:EnableHttpEndpoint,
rds:ModifyDBCluster,
rds:RestoreDBClusterFromSnapshot,
rds:RestoreDBClusterToPointInTime,
secretsmanager:CreateSecret,
secretsmanager:TagResource

Update

ec2:DescribeSecurityGroups,
iam:PassRole,
rds:AddRoleToDBCluster,
rds:AddTagsToResource,
rds:DescribeDBClusters,
rds:DescribeDBSubnetGroups,
rds:DescribeEvents,
rds:DescribeGlobalClusters,
rds:DisableHttpEndpoint,
rds:EnableHttpEndpoint,
rds:ModifyDBCluster,
rds:ModifyDBInstance,
rds:RemoveFromGlobalCluster,
rds:RemoveRoleFromDBCluster,
rds:RemoveTagsFromResource,
secretsmanager:CreateSecret,
secretsmanager:TagResource

List

rds:DescribeDBClusters

Delete

rds:CreateDBClusterSnapshot,
rds:DeleteDBCluster,
rds:DeleteDBInstance,
rds:DescribeDBClusters,
rds:DescribeGlobalClusters,
rds:RemoveFromGlobalCluster