Skip to content

restore_db_cluster_from_s3

restore_db_cluster_from_s3(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    availability_zones: Optional[AvailabilityZones] = None,
    backup_retention_period: Optional[IntegerOptional] = None,
    character_set_name: Optional[String] = None,
    database_name: Optional[String] = None,
    db_cluster_identifier: Optional[String] = None,
    db_cluster_parameter_group_name: Optional[String] = None,
    vpc_security_group_ids: Optional[VpcSecurityGroupIdList] = None,
    db_subnet_group_name: Optional[String] = None,
    engine: Optional[String] = None,
    engine_version: Optional[String] = None,
    port: Optional[IntegerOptional] = None,
    master_username: Optional[String] = None,
    master_user_password: Optional[SensitiveString] = None,
    option_group_name: Optional[String] = None,
    preferred_backup_window: Optional[String] = None,
    preferred_maintenance_window: Optional[String] = None,
    tags: Optional[TagList] = None,
    storage_encrypted: Optional[BooleanOptional] = None,
    kms_key_id: Optional[String] = None,
    enable_iam_database_authentication: Optional[BooleanOptional] = None,
    source_engine: Optional[String] = None,
    source_engine_version: Optional[String] = None,
    s3_bucket_name: Optional[String] = None,
    s3_prefix: Optional[String] = None,
    s3_ingestion_role_arn: Optional[String] = None,
    backtrack_window: Optional[LongOptional] = None,
    enable_cloudwatch_logs_exports: Optional[LogTypeList] = None,
    deletion_protection: Optional[BooleanOptional] = None,
    copy_tags_to_snapshot: Optional[BooleanOptional] = None,
    domain: Optional[String] = None,
    domain_iam_role_name: Optional[String] = None,
    storage_type: Optional[String] = None,
    network_type: Optional[String] = None,
    serverless_v2_scaling_configuration: Optional[
        ServerlessV2ScalingConfiguration
    ] = None,
    manage_master_user_password: Optional[BooleanOptional] = None,
    master_user_secret_kms_key_id: Optional[String] = None,
    engine_lifecycle_support: Optional[String] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    associated_roles: Optional[DBClusterAssociatedRoles] = None,
) -> RestoreDBClusterFromS3Result

Creates an Amazon Aurora DB cluster from MySQL data stored in an Amazon S3 bucket. Amazon RDS must be authorized to access the Amazon S3 bucket and the data must be created using the Percona XtraBackup utility as described in Migrating Data from MySQL by Using an Amazon S3 Bucket in the Amazon Aurora User Guide.

This operation only restores the DB cluster, not the DB instances for that DB cluster. You must invoke the CreateDBInstance operation to create DB instances for the restored DB cluster, specifying the identifier of the restored DB cluster in DBClusterIdentifier. You can create DB instances only after the RestoreDBClusterFromS3 operation has completed and the DB cluster is available.

For more information on Amazon Aurora, see What is Amazon Aurora? in the Amazon Aurora User Guide.

This operation only applies to Aurora DB clusters. The source DB engine must be MySQL.

You can use the AssociatedRoles parameter to associate one or more Amazon Web Services Identity and Access Management (IAM) roles with the Aurora DB cluster when you restore it from Amazon S3.

Parameters:

  • availability_zones (Optional[AvailabilityZones], default: None ) –

    A list of Availability Zones (AZs) where instances in the restored DB cluster can be created.

  • backup_retention_period (Optional[IntegerOptional], default: None ) –

    The number of days for which automated backups of the restored DB cluster are retained. You must specify a minimum value of 1.

    Default: 1

    Constraints:

    • Must be a value from 1 to 35

  • character_set_name (Optional[String], default: None ) –

    A value that indicates that the restored DB cluster should be associated with the specified CharacterSet.

  • database_name (Optional[String], default: None ) –

    The database name for the restored DB cluster.

  • db_cluster_identifier (Optional[String], default: None ) –

    The name of the DB cluster to create from the source data in the Amazon S3 bucket. This parameter isn't case-sensitive.

    Constraints:

    • Must contain from 1 to 63 letters, numbers, or hyphens.

    • First character must be a letter.

    • Can't end with a hyphen or contain two consecutive hyphens.

    Example: my-cluster1

  • db_cluster_parameter_group_name (Optional[String], default: None ) –

    The name of the DB cluster parameter group to associate with the restored DB cluster. If this argument is omitted, the default parameter group for the engine version is used.

    Constraints:

    • If supplied, must match the name of an existing DBClusterParameterGroup.

  • vpc_security_group_ids (Optional[VpcSecurityGroupIdList], default: None ) –

    A list of EC2 VPC security groups to associate with the restored DB cluster.

  • db_subnet_group_name (Optional[String], default: None ) –

    A DB subnet group to associate with the restored DB cluster.

    Constraints: If supplied, must match the name of an existing DBSubnetGroup.

    Example: mydbsubnetgroup

  • engine (Optional[String], default: None ) –

    The name of the database engine to be used for this DB cluster.

    Valid Values: aurora-mysql (for Aurora MySQL)

  • engine_version (Optional[String], default: None ) –

    The version number of the database engine to use.

    To list all of the available engine versions for aurora-mysql (Aurora MySQL), use the following command:

    aws rds describe-db-engine-versions --engine aurora-mysql --query "DBEngineVersions[].EngineVersion"

    Aurora MySQL

    Examples: 5.7.mysql_aurora.2.12.0, 8.0.mysql_aurora.3.04.0

  • port (Optional[IntegerOptional], default: None ) –

    The port number on which the instances in the restored DB cluster accept connections.

    Default: 3306

  • master_username (Optional[String], default: None ) –

    The name of the master user for the restored DB cluster.

    Constraints:

    • Must be 1 to 16 letters or numbers.

    • First character must be a letter.

    • Can't be a reserved word for the chosen database engine.

  • master_user_password (Optional[SensitiveString], default: None ) –

    The password for the master database user. This password can contain any printable ASCII character except "/", """, or "@".

    Constraints:

    • Must contain from 8 to 41 characters.

    • Can't be specified if ManageMasterUserPassword is turned on.

  • option_group_name (Optional[String], default: None ) –

    A value that indicates that the restored DB cluster should be associated with the specified option group.

    Permanent options can't be removed from an option group. An option group can't be removed from a DB cluster once it is associated with a DB cluster.

  • preferred_backup_window (Optional[String], default: None ) –

    The 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 Amazon Web Services Region. To view the time blocks available, see Backup window in the Amazon Aurora User Guide.

    Constraints:

    • Must be in the format hh24:mi-hh24:mi.

    • Must be in Universal Coordinated Time (UTC).

    • Must not conflict with the preferred maintenance window.

    • Must be at least 30 minutes.

  • preferred_maintenance_window (Optional[String], default: None ) –

    The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

    Format: ddd:hh24:mi-ddd:hh24:mi

    The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week. To see the time blocks available, see Adjusting the Preferred Maintenance Window in the Amazon Aurora User Guide.

    Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.

    Constraints: Minimum 30-minute window.

  • storage_encrypted (Optional[BooleanOptional], default: None ) –

    Specifies whether the restored DB cluster is encrypted.

  • kms_key_id (Optional[String], default: None ) –

    The Amazon Web Services KMS key identifier for an encrypted DB cluster.

    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 the StorageEncrypted parameter is enabled, and you do not specify a value for the KmsKeyId parameter, then Amazon RDS will use your default 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.

  • enable_iam_database_authentication (Optional[BooleanOptional], default: None ) –

    Specifies whether to enable mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database accounts. By default, mapping isn't enabled.

    For more information, see IAM Database Authentication in the Amazon Aurora User Guide.

  • source_engine (Optional[String], default: None ) –

    The identifier for the database engine that was backed up to create the files stored in the Amazon S3 bucket.

    Valid Values: mysql

  • source_engine_version (Optional[String], default: None ) –

    The version of the database that the backup files were created from.

    MySQL versions 5.7 and 8.0 are supported.

    Example: 5.7.40, 8.0.28

  • s3_bucket_name (Optional[String], default: None ) –

    The name of the Amazon S3 bucket that contains the data used to create the Amazon Aurora DB cluster.

  • s3_prefix (Optional[String], default: None ) –

    The prefix for all of the file names that contain the data used to create the Amazon Aurora DB cluster. If you do not specify a SourceS3Prefix value, then the Amazon Aurora DB cluster is created by using all of the files in the Amazon S3 bucket.

  • s3_ingestion_role_arn (Optional[String], default: None ) –

    The Amazon Resource Name (ARN) of the Amazon Web Services Identity and Access Management (IAM) role that authorizes Amazon RDS to access the Amazon S3 bucket on your behalf.

  • backtrack_window (Optional[LongOptional], default: None ) –

    The target backtrack window, in seconds. To disable backtracking, set this value to 0.

    Currently, Backtrack is only supported for Aurora MySQL DB clusters.

    Default: 0

    Constraints:

    • If specified, this value must be set to a number from 0 to 259,200 (72 hours).

  • enable_cloudwatch_logs_exports (Optional[LogTypeList], default: None ) –

    The list of logs that the restored DB cluster is to export to CloudWatch Logs. The values in the list depend on the DB engine being used.

    Aurora MySQL

    Possible values are audit, error, general, instance, slowquery, and iam-db-auth-error.

    Aurora PostgreSQL

    Possible value are instance, postgresql, and iam-db-auth-error.

    For more information about exporting CloudWatch Logs for Amazon RDS, see Publishing Database Logs to Amazon CloudWatch Logs in the Amazon RDS User Guide.

    For more information about exporting CloudWatch Logs for Amazon Aurora, see Publishing Database Logs to Amazon CloudWatch Logs in the Amazon Aurora User Guide.

  • deletion_protection (Optional[BooleanOptional], default: None ) –

    Specifies whether to enable deletion protection for the DB cluster. The database can't be deleted when deletion protection is enabled. By default, deletion protection isn't enabled.

  • copy_tags_to_snapshot (Optional[BooleanOptional], default: None ) –

    Specifies whether to copy all tags from the restored DB cluster to snapshots of the restored DB cluster. The default is not to copy them.

  • domain (Optional[String], default: None ) –

    Specify the Active Directory directory ID to restore the DB cluster in. The domain must be created prior to this operation.

    For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to authenticate users that connect to the DB cluster. For more information, see Kerberos Authentication in the Amazon Aurora User Guide.

  • domain_iam_role_name (Optional[String], default: None ) –

    Specify the name of the IAM role to be used when making API calls to the Directory Service.

  • storage_type (Optional[String], default: None ) –

    Specifies the storage type to be associated with the DB cluster.

    Valid Values: aurora, aurora-iopt1

    Default: aurora

    Valid for: Aurora DB clusters only

  • network_type (Optional[String], default: None ) –

    The network type of the DB cluster.

    Valid Values:

    • IPV4

    • DUAL

    The network type is determined by the DBSubnetGroup specified for the DB cluster. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the IPv6 protocols (DUAL).

    For more information, see Working with a DB instance in a VPC in the Amazon Aurora User Guide.

  • manage_master_user_password (Optional[BooleanOptional], default: None ) –

    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 and Password management with Amazon Web Services Secrets Manager in the Amazon Aurora User Guide.

    Constraints:

    • Can't manage the master user password with Amazon Web Services Secrets Manager if MasterUserPassword is specified.

  • master_user_secret_kms_key_id (Optional[String], default: None ) –

    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 cluster.

    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.

  • engine_lifecycle_support (Optional[String], default: None ) –

    The lifecycle type for this DB cluster.

    By default, this value is set to open-source-rds-extended-support, which enrolls your DB cluster into Amazon RDS Extended Support. At the end of standard support, you can avoid charges for Extended Support by setting the value to open-source-rds-extended-support-disabled. In this case, RDS automatically upgrades your restored DB cluster to a higher engine version, if the major engine version is past its end of standard support date.

    You can use this setting to enroll your DB cluster into Amazon RDS Extended Support. With RDS Extended Support, you can run the selected major engine version on your DB cluster past the end of standard support for that engine version. For more information, see the following sections:

    Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters

    Valid Values: open-source-rds-extended-support | open-source-rds-extended-support-disabled

    Default: open-source-rds-extended-support

  • tag_specifications (Optional[TagSpecificationList], default: None ) –

    Tags to assign to resources associated with the DB cluster.

    Valid Values:

    • cluster-auto-backup - The DB cluster's automated backup.

  • associated_roles (Optional[DBClusterAssociatedRoles], default: None ) –

    A list of Amazon Web Services Identity and Access Management (IAM) roles to associate with the DB cluster when it's restored from Amazon S3. Each role grants the DB cluster permission to access other Amazon Web Services on your behalf. For each role, specify a role ARN and, optionally, the feature name (such as s3Import, s3Export, or Lambda).

Raises:

  • DBClusterAlreadyExistsFault –

    The user already has a DB cluster with the given identifier.

  • DBClusterNotFoundFault –

    DBClusterIdentifier doesn't refer to an existing DB cluster.

  • DBClusterParameterGroupNotFoundFault –

    DBClusterParameterGroupName doesn't refer to an existing DB cluster parameter group.

  • DBClusterQuotaExceededFault –

    The user attempted to create a new DB cluster and the user has already reached the maximum allowed DB cluster quota.

  • DBClusterRoleQuotaExceededFault –

    You have exceeded the maximum number of IAM roles that can be associated with the specified DB cluster.

  • DBSubnetGroupNotFoundFault –

    DBSubnetGroupName doesn't refer to an existing DB subnet group.

  • DomainNotFoundFault –

    Domain doesn't refer to an existing Active Directory domain.

  • InsufficientStorageClusterCapacityFault –

    There is insufficient storage available for the current action. You might be able to resolve this error by updating your subnet group to use different Availability Zones that have more storage available.

  • InvalidDBClusterStateFault –

    The requested operation can't be performed while the cluster is in this state.

  • InvalidDBSubnetGroupStateFault –

    The DB subnet group cannot be deleted because it's in use.

  • InvalidS3BucketFault –

    The specified Amazon S3 bucket name can't be found or Amazon RDS isn't authorized to access the specified Amazon S3 bucket. Verify the SourceS3BucketName and S3IngestionRoleArn values and try again.

  • InvalidSubnet –

    The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.

  • InvalidVPCNetworkStateFault –

    The DB subnet group doesn't cover all Availability Zones after it's created because of users' change.

  • KMSKeyNotAccessibleFault –

    An error occurred accessing an Amazon Web Services KMS key.

  • NetworkTypeNotSupported –

    The network type is invalid for the DB instance. Valid nework type values are IPV4 and DUAL.

  • StorageQuotaExceededFault –

    The request would result in the user exceeding the allowed amount of storage available across all DB instances.

  • StorageTypeNotSupportedFault –

    The specified StorageType can't be associated with the DB instance.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To restore an Amazon Aurora DB cluster from Amazon S3 The following example restores an Amazon Aurora MySQL version 5.7-compatible DB cluster from a MySQL 5.7 DB backup file in Amazon S3.

>>> client.restore_db_cluster_from_s3(db_cluster_identifier='cluster-s3-restore', engine='aurora-mysql', master_username='admin', master_user_password='mypassword', source_engine='mysql', source_engine_version='5.7.28', s3_bucket_name='mybucket', s3_prefix='test-backup', s3_ingestion_role_arn='arn:aws:iam::123456789012:role/service-role/TestBackup')
Source code in docs_src/capo_rds/_services/rds.py
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
def restore_db_cluster_from_s3(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    availability_zones: Optional[
        "capo_rds.types.availability_zones.AvailabilityZones"
    ] = None,
    backup_retention_period: Optional[
        "capo_rds.types.integer_optional.IntegerOptional"
    ] = None,
    character_set_name: Optional["capo_rds.types.string.String"] = None,
    database_name: Optional["capo_rds.types.string.String"] = None,
    db_cluster_identifier: Optional["capo_rds.types.string.String"] = None,
    db_cluster_parameter_group_name: Optional[
        "capo_rds.types.string.String"
    ] = None,
    vpc_security_group_ids: Optional[
        "capo_rds.types.vpc_security_group_id_list.VpcSecurityGroupIdList"
    ] = None,
    db_subnet_group_name: Optional["capo_rds.types.string.String"] = None,
    engine: Optional["capo_rds.types.string.String"] = None,
    engine_version: Optional["capo_rds.types.string.String"] = None,
    port: Optional["capo_rds.types.integer_optional.IntegerOptional"] = None,
    master_username: Optional["capo_rds.types.string.String"] = None,
    master_user_password: Optional[
        "capo_rds.types.sensitive_string.SensitiveString"
    ] = None,
    option_group_name: Optional["capo_rds.types.string.String"] = None,
    preferred_backup_window: Optional["capo_rds.types.string.String"] = None,
    preferred_maintenance_window: Optional["capo_rds.types.string.String"] = None,
    tags: Optional["capo_rds.types.tag_list.TagList"] = None,
    storage_encrypted: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
    kms_key_id: Optional["capo_rds.types.string.String"] = None,
    enable_iam_database_authentication: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
    source_engine: Optional["capo_rds.types.string.String"] = None,
    source_engine_version: Optional["capo_rds.types.string.String"] = None,
    s3_bucket_name: Optional["capo_rds.types.string.String"] = None,
    s3_prefix: Optional["capo_rds.types.string.String"] = None,
    s3_ingestion_role_arn: Optional["capo_rds.types.string.String"] = None,
    backtrack_window: Optional["capo_rds.types.long_optional.LongOptional"] = None,
    enable_cloudwatch_logs_exports: Optional[
        "capo_rds.types.log_type_list.LogTypeList"
    ] = None,
    deletion_protection: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
    copy_tags_to_snapshot: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
    domain: Optional["capo_rds.types.string.String"] = None,
    domain_iam_role_name: Optional["capo_rds.types.string.String"] = None,
    storage_type: Optional["capo_rds.types.string.String"] = None,
    network_type: Optional["capo_rds.types.string.String"] = None,
    serverless_v2_scaling_configuration: Optional[
        "capo_rds.types.serverless_v2_scaling_configuration.ServerlessV2ScalingConfiguration"
    ] = None,
    manage_master_user_password: Optional[
        "capo_rds.types.boolean_optional.BooleanOptional"
    ] = None,
    master_user_secret_kms_key_id: Optional["capo_rds.types.string.String"] = None,
    engine_lifecycle_support: Optional["capo_rds.types.string.String"] = None,
    tag_specifications: Optional[
        "capo_rds.types.tag_specification_list.TagSpecificationList"
    ] = None,
    associated_roles: Optional[
        "capo_rds.types.db_cluster_associated_roles.DBClusterAssociatedRoles"
    ] = None,
) -> (
    "capo_rds.types.restore_db_cluster_from_s3_result.RestoreDBClusterFromS3Result"
):
    """<p>Creates an Amazon Aurora DB cluster from MySQL data stored in an Amazon S3 bucket. Amazon RDS must be authorized to access the Amazon S3 bucket and the data must be created using the Percona XtraBackup utility as described in <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Migrating.ExtMySQL.html#AuroraMySQL.Migrating.ExtMySQL.S3\"> Migrating Data from MySQL by Using an Amazon S3 Bucket</a> in the <i>Amazon Aurora User Guide</i>.</p> <note> <p>This operation only restores the DB cluster, not the DB instances for that DB cluster. You must invoke the <code>CreateDBInstance</code> operation to create DB instances for the restored DB cluster, specifying the identifier of the restored DB cluster in <code>DBClusterIdentifier</code>. You can create DB instances only after the <code>RestoreDBClusterFromS3</code> operation has completed and the DB cluster is available.</p> </note> <p>For more information on Amazon Aurora, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html\"> What is Amazon Aurora?</a> in the <i>Amazon Aurora User Guide</i>.</p> <note> <p>This operation only applies to Aurora DB clusters. The source DB engine must be MySQL.</p> </note> <p>You can use the <code>AssociatedRoles</code> parameter to associate one or more Amazon Web Services Identity and Access Management (IAM) roles with the Aurora DB cluster when you restore it from Amazon S3.</p>

    Args:
        availability_zones: <p>A list of Availability Zones (AZs) where instances in the restored DB cluster can be created.</p>
        backup_retention_period: <p>The number of days for which automated backups of the restored DB cluster are retained. You must specify a minimum value of 1.</p> <p>Default: 1</p> <p>Constraints:</p> <ul> <li> <p>Must be a value from 1 to 35</p> </li> </ul>
        character_set_name: <p>A value that indicates that the restored DB cluster should be associated with the specified CharacterSet.</p>
        database_name: <p>The database name for the restored DB cluster.</p>
        db_cluster_identifier: <p>The name of the DB cluster to create from the source data in the Amazon S3 bucket. This parameter isn't case-sensitive.</p> <p>Constraints:</p> <ul> <li> <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p> </li> <li> <p>First character must be a letter.</p> </li> <li> <p>Can't end with a hyphen or contain two consecutive hyphens.</p> </li> </ul> <p>Example: <code>my-cluster1</code> </p>
        db_cluster_parameter_group_name: <p>The name of the DB cluster parameter group to associate with the restored DB cluster. If this argument is omitted, the default parameter group for the engine version is used.</p> <p>Constraints:</p> <ul> <li> <p>If supplied, must match the name of an existing DBClusterParameterGroup.</p> </li> </ul>
        vpc_security_group_ids: <p>A list of EC2 VPC security groups to associate with the restored DB cluster.</p>
        db_subnet_group_name: <p>A DB subnet group to associate with the restored DB cluster.</p> <p>Constraints: If supplied, must match the name of an existing DBSubnetGroup.</p> <p>Example: <code>mydbsubnetgroup</code> </p>
        engine: <p>The name of the database engine to be used for this DB cluster.</p> <p>Valid Values: <code>aurora-mysql</code> (for Aurora MySQL)</p>
        engine_version: <p>The version number of the database engine to use.</p> <p>To list all of the available engine versions for <code>aurora-mysql</code> (Aurora MySQL), use the following command:</p> <p> <code>aws rds describe-db-engine-versions --engine aurora-mysql --query \"DBEngineVersions[].EngineVersion\"</code> </p> <p> <b>Aurora MySQL</b> </p> <p>Examples: <code>5.7.mysql_aurora.2.12.0</code>, <code>8.0.mysql_aurora.3.04.0</code> </p>
        port: <p>The port number on which the instances in the restored DB cluster accept connections.</p> <p>Default: <code>3306</code> </p>
        master_username: <p>The name of the master user for the restored DB cluster.</p> <p>Constraints:</p> <ul> <li> <p>Must be 1 to 16 letters or numbers.</p> </li> <li> <p>First character must be a letter.</p> </li> <li> <p>Can't be a reserved word for the chosen database engine.</p> </li> </ul>
        master_user_password: <p>The password for the master database user. This password can contain any printable ASCII character except \"/\", \"\"\", or \"@\".</p> <p>Constraints:</p> <ul> <li> <p>Must contain from 8 to 41 characters.</p> </li> <li> <p>Can't be specified if <code>ManageMasterUserPassword</code> is turned on.</p> </li> </ul>
        option_group_name: <p>A value that indicates that the restored DB cluster should be associated with the specified option group.</p> <p>Permanent options can't be removed from an option group. An option group can't be removed from a DB cluster once it is associated with a DB cluster.</p>
        preferred_backup_window: <p>The daily time range during which automated backups are created if automated backups are enabled using the <code>BackupRetentionPeriod</code> parameter.</p> <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To view the time blocks available, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.Backups.BackupWindow\"> Backup window</a> in the <i>Amazon Aurora User Guide</i>.</p> <p>Constraints:</p> <ul> <li> <p>Must be in the format <code>hh24:mi-hh24:mi</code>.</p> </li> <li> <p>Must be in Universal Coordinated Time (UTC).</p> </li> <li> <p>Must not conflict with the preferred maintenance window.</p> </li> <li> <p>Must be at least 30 minutes.</p> </li> </ul>
        preferred_maintenance_window: <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p> <p>Format: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p> <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week. To see the time blocks available, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora\"> Adjusting the Preferred Maintenance Window</a> in the <i>Amazon Aurora User Guide</i>.</p> <p>Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.</p> <p>Constraints: Minimum 30-minute window.</p>
        storage_encrypted: <p>Specifies whether the restored DB cluster is encrypted.</p>
        kms_key_id: <p>The Amazon Web Services KMS key identifier for an encrypted DB cluster.</p> <p>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.</p> <p>If the StorageEncrypted parameter is enabled, and you do not specify a value for the <code>KmsKeyId</code> parameter, then Amazon RDS will use your default 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.</p>
        enable_iam_database_authentication: <p>Specifies whether to enable mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database accounts. By default, mapping isn't enabled.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html\"> IAM Database Authentication</a> in the <i>Amazon Aurora User Guide</i>.</p>
        source_engine: <p>The identifier for the database engine that was backed up to create the files stored in the Amazon S3 bucket.</p> <p>Valid Values: <code>mysql</code> </p>
        source_engine_version: <p>The version of the database that the backup files were created from.</p> <p>MySQL versions 5.7 and 8.0 are supported.</p> <p>Example: <code>5.7.40</code>, <code>8.0.28</code> </p>
        s3_bucket_name: <p>The name of the Amazon S3 bucket that contains the data used to create the Amazon Aurora DB cluster.</p>
        s3_prefix: <p>The prefix for all of the file names that contain the data used to create the Amazon Aurora DB cluster. If you do not specify a <b>SourceS3Prefix</b> value, then the Amazon Aurora DB cluster is created by using all of the files in the Amazon S3 bucket.</p>
        s3_ingestion_role_arn: <p>The Amazon Resource Name (ARN) of the Amazon Web Services Identity and Access Management (IAM) role that authorizes Amazon RDS to access the Amazon S3 bucket on your behalf.</p>
        backtrack_window: <p>The target backtrack window, in seconds. To disable backtracking, set this value to 0.</p> <note> <p>Currently, Backtrack is only supported for Aurora MySQL DB clusters.</p> </note> <p>Default: 0</p> <p>Constraints:</p> <ul> <li> <p>If specified, this value must be set to a number from 0 to 259,200 (72 hours).</p> </li> </ul>
        enable_cloudwatch_logs_exports: <p>The list of logs that the restored DB cluster is to export to CloudWatch Logs. The values in the list depend on the DB engine being used.</p> <p> <b>Aurora MySQL</b> </p> <p>Possible values are <code>audit</code>, <code>error</code>, <code>general</code>, <code>instance</code>, <code>slowquery</code>, and <code>iam-db-auth-error</code>.</p> <p> <b>Aurora PostgreSQL</b> </p> <p>Possible value are <code>instance</code>, <code>postgresql</code>, and <code>iam-db-auth-error</code>.</p> <p>For more information about exporting CloudWatch Logs for Amazon RDS, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch\">Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon RDS User Guide</i>.</p> <p>For more information about exporting CloudWatch Logs for Amazon Aurora, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch\">Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.</p>
        deletion_protection: <p>Specifies whether to enable deletion protection for the DB cluster. The database can't be deleted when deletion protection is enabled. By default, deletion protection isn't enabled.</p>
        copy_tags_to_snapshot: <p>Specifies whether to copy all tags from the restored DB cluster to snapshots of the restored DB cluster. The default is not to copy them.</p>
        domain: <p>Specify the Active Directory directory ID to restore the DB cluster in. The domain must be created prior to this operation.</p> <p>For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to authenticate users that connect to the DB cluster. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html\">Kerberos Authentication</a> in the <i>Amazon Aurora User Guide</i>.</p>
        domain_iam_role_name: <p>Specify the name of the IAM role to be used when making API calls to the Directory Service.</p>
        storage_type: <p>Specifies the storage type to be associated with the DB cluster.</p> <p>Valid Values: <code>aurora</code>, <code>aurora-iopt1</code> </p> <p>Default: <code>aurora</code> </p> <p>Valid for: Aurora DB clusters only</p>
        network_type: <p>The network type of the DB cluster.</p> <p>Valid Values:</p> <ul> <li> <p> <code>IPV4</code> </p> </li> <li> <p> <code>DUAL</code> </p> </li> </ul> <p>The network type is determined by the <code>DBSubnetGroup</code> specified for the DB cluster. A <code>DBSubnetGroup</code> can support only the IPv4 protocol or the IPv4 and the IPv6 protocols (<code>DUAL</code>).</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html\"> Working with a DB instance in a VPC</a> in the <i>Amazon Aurora User Guide.</i> </p>
        manage_master_user_password: <p>Specifies whether to manage the master user password with Amazon Web Services Secrets Manager.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html\">Password management with Amazon Web Services Secrets Manager</a> in the <i>Amazon RDS User Guide</i> and <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html\">Password management with Amazon Web Services Secrets Manager</a> in the <i>Amazon Aurora User Guide.</i> </p> <p>Constraints:</p> <ul> <li> <p>Can't manage the master user password with Amazon Web Services Secrets Manager if <code>MasterUserPassword</code> is specified.</p> </li> </ul>
        master_user_secret_kms_key_id: <p>The Amazon Web Services KMS key identifier to encrypt a secret that is automatically generated and managed in Amazon Web Services Secrets Manager.</p> <p>This setting is valid only if the master user password is managed by RDS in Amazon Web Services Secrets Manager for the DB cluster.</p> <p>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.</p> <p>If you don't specify <code>MasterUserSecretKmsKeyId</code>, then the <code>aws/secretsmanager</code> 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 <code>aws/secretsmanager</code> KMS key to encrypt the secret, and you must use a customer managed KMS key.</p> <p>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.</p>
        engine_lifecycle_support: <p>The lifecycle type for this DB cluster.</p> <note> <p>By default, this value is set to <code>open-source-rds-extended-support</code>, which enrolls your DB cluster into Amazon RDS Extended Support. At the end of standard support, you can avoid charges for Extended Support by setting the value to <code>open-source-rds-extended-support-disabled</code>. In this case, RDS automatically upgrades your restored DB cluster to a higher engine version, if the major engine version is past its end of standard support date.</p> </note> <p>You can use this setting to enroll your DB cluster into Amazon RDS Extended Support. With RDS Extended Support, you can run the selected major engine version on your DB cluster past the end of standard support for that engine version. For more information, see the following sections:</p> <ul> <li> <p>Amazon Aurora - <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/extended-support.html\">Amazon RDS Extended Support with Amazon Aurora</a> in the <i>Amazon Aurora User Guide</i> </p> </li> <li> <p>Amazon RDS - <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html\">Amazon RDS Extended Support with Amazon RDS</a> in the <i>Amazon RDS User Guide</i> </p> </li> </ul> <p>Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters</p> <p>Valid Values: <code>open-source-rds-extended-support | open-source-rds-extended-support-disabled</code> </p> <p>Default: <code>open-source-rds-extended-support</code> </p>
        tag_specifications: <p>Tags to assign to resources associated with the DB cluster.</p> <p>Valid Values: </p> <ul> <li> <p> <code>cluster-auto-backup</code> - The DB cluster's automated backup.</p> </li> </ul>
        associated_roles: <p>A list of Amazon Web Services Identity and Access Management (IAM) roles to associate with the DB cluster when it's restored from Amazon S3. Each role grants the DB cluster permission to access other Amazon Web Services on your behalf. For each role, specify a role ARN and, optionally, the feature name (such as <code>s3Import</code>, <code>s3Export</code>, or <code>Lambda</code>).</p>

    Raises:
        capo_rds.errors.db_cluster_already_exists_fault.DBClusterAlreadyExistsFault: <p>The user already has a DB cluster with the given identifier.</p>
        capo_rds.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <code>DBClusterIdentifier</code> doesn't refer to an existing DB cluster.</p>
        capo_rds.errors.db_cluster_parameter_group_not_found_fault.DBClusterParameterGroupNotFoundFault: <p> <code>DBClusterParameterGroupName</code> doesn't refer to an existing DB cluster parameter group.</p>
        capo_rds.errors.db_cluster_quota_exceeded_fault.DBClusterQuotaExceededFault: <p>The user attempted to create a new DB cluster and the user has already reached the maximum allowed DB cluster quota.</p>
        capo_rds.errors.db_cluster_role_quota_exceeded_fault.DBClusterRoleQuotaExceededFault: <p>You have exceeded the maximum number of IAM roles that can be associated with the specified DB cluster.</p>
        capo_rds.errors.db_subnet_group_not_found_fault.DBSubnetGroupNotFoundFault: <p> <code>DBSubnetGroupName</code> doesn't refer to an existing DB subnet group.</p>
        capo_rds.errors.domain_not_found_fault.DomainNotFoundFault: <p> <code>Domain</code> doesn't refer to an existing Active Directory domain.</p>
        capo_rds.errors.insufficient_storage_cluster_capacity_fault.InsufficientStorageClusterCapacityFault: <p>There is insufficient storage available for the current action. You might be able to resolve this error by updating your subnet group to use different Availability Zones that have more storage available.</p>
        capo_rds.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The requested operation can't be performed while the cluster is in this state.</p>
        capo_rds.errors.invalid_db_subnet_group_state_fault.InvalidDBSubnetGroupStateFault: <p>The DB subnet group cannot be deleted because it's in use.</p>
        capo_rds.errors.invalid_s3_bucket_fault.InvalidS3BucketFault: <p>The specified Amazon S3 bucket name can't be found or Amazon RDS isn't authorized to access the specified Amazon S3 bucket. Verify the <b>SourceS3BucketName</b> and <b>S3IngestionRoleArn</b> values and try again.</p>
        capo_rds.errors.invalid_subnet.InvalidSubnet: <p>The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.</p>
        capo_rds.errors.invalid_vpc_network_state_fault.InvalidVPCNetworkStateFault: <p>The DB subnet group doesn't cover all Availability Zones after it's created because of users' change.</p>
        capo_rds.errors.kms_key_not_accessible_fault.KMSKeyNotAccessibleFault: <p>An error occurred accessing an Amazon Web Services KMS key.</p>
        capo_rds.errors.network_type_not_supported.NetworkTypeNotSupported: <p>The network type is invalid for the DB instance. Valid nework type values are <code>IPV4</code> and <code>DUAL</code>.</p>
        capo_rds.errors.storage_quota_exceeded_fault.StorageQuotaExceededFault: <p>The request would result in the user exceeding the allowed amount of storage available across all DB instances.</p>
        capo_rds.errors.storage_type_not_supported_fault.StorageTypeNotSupportedFault: <p>The specified <code>StorageType</code> can't be associated with the DB instance.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To restore an Amazon Aurora DB cluster from Amazon S3
        The following example restores an Amazon Aurora MySQL version 5.7-compatible DB cluster from a MySQL 5.7 DB backup file in Amazon S3.

        >>> client.restore_db_cluster_from_s3(db_cluster_identifier='cluster-s3-restore', engine='aurora-mysql', master_username='admin', master_user_password='mypassword', source_engine='mysql', source_engine_version='5.7.28', s3_bucket_name='mybucket', s3_prefix='test-backup', s3_ingestion_role_arn='arn:aws:iam::123456789012:role/service-role/TestBackup')
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.restore_db_cluster_from_s3_message.RestoreDBClusterFromS3Message]",
    ) -> OperationResponse[
        "capo_rds.types.restore_db_cluster_from_s3_result.RestoreDBClusterFromS3Result"
    ]:
        import capo_rds._operations.amazon_rd_sv19.restore_db_cluster_from_s3

        output, http_response = (
            capo_rds._operations.amazon_rd_sv19.restore_db_cluster_from_s3.restore_db_cluster_from_s3(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_rds.types.restore_db_cluster_from_s3_message.RestoreDBClusterFromS3Message",
    ) -> dict[str, Any]:
        import capo_rds.types.restore_db_cluster_from_s3_message

        return capo_rds.types.restore_db_cluster_from_s3_message.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_rds.types.restore_db_cluster_from_s3_result.RestoreDBClusterFromS3Result",
    ) -> dict[str, Any]:
        import capo_rds.types.restore_db_cluster_from_s3_result

        return capo_rds.types.restore_db_cluster_from_s3_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "RestoreDBClusterFromS3",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_rds.types.restore_db_cluster_from_s3_message.RestoreDBClusterFromS3Message = {}
    if availability_zones is not None:
        input_["availability_zones"] = availability_zones
    if backup_retention_period is not None:
        input_["backup_retention_period"] = backup_retention_period
    if character_set_name is not None:
        input_["character_set_name"] = character_set_name
    if database_name is not None:
        input_["database_name"] = database_name
    if db_cluster_identifier is not None:
        input_["db_cluster_identifier"] = db_cluster_identifier
    if db_cluster_parameter_group_name is not None:
        input_["db_cluster_parameter_group_name"] = db_cluster_parameter_group_name
    if vpc_security_group_ids is not None:
        input_["vpc_security_group_ids"] = vpc_security_group_ids
    if db_subnet_group_name is not None:
        input_["db_subnet_group_name"] = db_subnet_group_name
    if engine is not None:
        input_["engine"] = engine
    if engine_version is not None:
        input_["engine_version"] = engine_version
    if port is not None:
        input_["port"] = port
    if master_username is not None:
        input_["master_username"] = master_username
    if master_user_password is not None:
        input_["master_user_password"] = master_user_password
    if option_group_name is not None:
        input_["option_group_name"] = option_group_name
    if preferred_backup_window is not None:
        input_["preferred_backup_window"] = preferred_backup_window
    if preferred_maintenance_window is not None:
        input_["preferred_maintenance_window"] = preferred_maintenance_window
    if tags is not None:
        input_["tags"] = tags
    if storage_encrypted is not None:
        input_["storage_encrypted"] = storage_encrypted
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id
    if enable_iam_database_authentication is not None:
        input_["enable_iam_database_authentication"] = (
            enable_iam_database_authentication
        )
    if source_engine is not None:
        input_["source_engine"] = source_engine
    if source_engine_version is not None:
        input_["source_engine_version"] = source_engine_version
    if s3_bucket_name is not None:
        input_["s3_bucket_name"] = s3_bucket_name
    if s3_prefix is not None:
        input_["s3_prefix"] = s3_prefix
    if s3_ingestion_role_arn is not None:
        input_["s3_ingestion_role_arn"] = s3_ingestion_role_arn
    if backtrack_window is not None:
        input_["backtrack_window"] = backtrack_window
    if enable_cloudwatch_logs_exports is not None:
        input_["enable_cloudwatch_logs_exports"] = enable_cloudwatch_logs_exports
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection
    if copy_tags_to_snapshot is not None:
        input_["copy_tags_to_snapshot"] = copy_tags_to_snapshot
    if domain is not None:
        input_["domain"] = domain
    if domain_iam_role_name is not None:
        input_["domain_iam_role_name"] = domain_iam_role_name
    if storage_type is not None:
        input_["storage_type"] = storage_type
    if network_type is not None:
        input_["network_type"] = network_type
    if serverless_v2_scaling_configuration is not None:
        input_["serverless_v2_scaling_configuration"] = (
            serverless_v2_scaling_configuration
        )
    if manage_master_user_password is not None:
        input_["manage_master_user_password"] = manage_master_user_password
    if master_user_secret_kms_key_id is not None:
        input_["master_user_secret_kms_key_id"] = master_user_secret_kms_key_id
    if engine_lifecycle_support is not None:
        input_["engine_lifecycle_support"] = engine_lifecycle_support
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications
    if associated_roles is not None:
        input_["associated_roles"] = associated_roles

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output