create_relational_database_from_snapshot
¶
create_relational_database_from_snapshot(
relational_database_name: ResourceName,
*,
config_overrides: Optional[LightsailClientConfig] = None,
availability_zone: Optional[string] = None,
publicly_accessible: Optional[boolean] = None,
relational_database_snapshot_name: Optional[ResourceName] = None,
relational_database_bundle_id: Optional[string] = None,
source_relational_database_name: Optional[ResourceName] = None,
restore_time: Optional[IsoDate] = None,
use_latest_restorable_time: Optional[boolean] = None,
tags: Optional[TagList] = None,
) -> CreateRelationalDatabaseFromSnapshotResult
Creates a new database from an existing database snapshot in Amazon Lightsail.
You can create a new database from a snapshot in if something goes wrong with your original database, or to change it to a different plan, such as a high availability or standard plan.
The create relational database from snapshot operation supports tag-based access control via request tags and resource tags applied to the resource identified by relationalDatabaseSnapshotName. For more information, see the Amazon Lightsail Developer Guide.
Parameters:
-
relational_database_name(ResourceName) –The name to use for your new Lightsail database resource.
Constraints:
-
Must contain from 2 to 255 alphanumeric characters, or hyphens.
-
The first and last character must be a letter or number.
-
-
availability_zone(Optional[string], default:None) –The Availability Zone in which to create your new database. Use the
us-east-2acase-sensitive format.You can get a list of Availability Zones by using the
get regionsoperation. Be sure to add theinclude relational database Availability Zonesparameter to your request. -
publicly_accessible(Optional[boolean], default:None) –Specifies the accessibility options for your new database. A value of
truespecifies a database that is available to resources outside of your Lightsail account. A value offalsespecifies a database that is available only to your Lightsail resources in the same region as your database. -
relational_database_snapshot_name(Optional[ResourceName], default:None) –The name of the database snapshot from which to create your new database.
-
relational_database_bundle_id(Optional[string], default:None) –The bundle ID for your new database. A bundle describes the performance specifications for your database.
You can get a list of database bundle IDs by using the
get relational database bundlesoperation.When creating a new database from a snapshot, you cannot choose a bundle that is smaller than the bundle of the source database.
-
source_relational_database_name(Optional[ResourceName], default:None) –The name of the source database.
-
restore_time(Optional[IsoDate], default:None) –The date and time to restore your database from.
Constraints:
-
Must be before the latest restorable time for the database.
-
Cannot be specified if the
use latest restorable timeparameter istrue. -
Specified in Coordinated Universal Time (UTC).
-
Specified in the Unix time format.
For example, if you wish to use a restore time of October 1, 2018, at 8 PM UTC, then you input
1538424000as the restore time.
-
-
use_latest_restorable_time(Optional[boolean], default:None) –Specifies whether your database is restored from the latest backup time. A value of
truerestores from the latest backup time.Default:
falseConstraints: Cannot be specified if the
restore timeparameter is provided. -
tags(Optional[TagList], default:None) –The tag keys and optional values to add to the resource during create.
Use the
TagResourceaction to tag a resource after it's created.
Raises:
-
AccessDeniedException–Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.
-
AccountSetupInProgressException–Lightsail throws this exception when an account is still in the setup in progress state.
-
InvalidInputException–Lightsail throws this exception when user input does not conform to the validation rules of an input field.
Domain and distribution APIs are only available in the N. Virginia (
us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration tous-east-1to create, view, or edit these resources. -
NotFoundException–Lightsail throws this exception when it cannot find a resource.
-
OperationFailureException–Lightsail throws this exception when an operation fails to execute.
-
RegionSetupInProgressException–Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.
-
ServiceException–A general service exception.
-
UnauthenticatedException–Lightsail throws this exception when the user has not been authenticated.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lightsail/_services/lightsail.py
2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 | |