Skip to main content

relational_database_snapshots

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

Overview

Namerelational_database_snapshots
TypeResource
Idaws.lightsail.relational_database_snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the database snapshot. (pattern: <code>\w[\w-]*\w</code>)
arnstringThe Amazon Resource Name (ARN) of the database snapshot. (pattern: <code>.\S.</code>)
created_atstring (date-time)The timestamp when the database snapshot was created.
enginestringThe software of the database snapshot (for example, MySQL) (pattern: <code>.\S.</code>)
engine_versionstringThe database engine version for the database snapshot (for example, 5.7.23). (pattern: <code>.\S.</code>)
from_relational_database_arnstringThe Amazon Resource Name (ARN) of the database from which the database snapshot was created. (pattern: <code>.\S.</code>)
from_relational_database_blueprint_idstringThe blueprint ID of the database from which the database snapshot was created. A blueprint describes the major engine version of a database.
from_relational_database_bundle_idstringThe bundle ID of the database from which the database snapshot was created.
from_relational_database_namestringThe name of the source database from which the database snapshot was created. (pattern: <code>.\S.</code>)
locationobjectThe Region name and Availability Zone where the database snapshot is located.
resource_typestringThe Lightsail resource type. (ContainerService, Instance, StaticIp, KeyPair, InstanceSnapshot, Domain, PeeredVpc, LoadBalancer, LoadBalancerTlsCertificate, Disk, DiskSnapshot, RelationalDatabase, RelationalDatabaseSnapshot, ExportSnapshotRecord, CloudFormationStackRecord, Alarm, ContactMethod, Distribution, Certificate, Bucket)
size_in_gbintegerThe size of the disk in GB (for example, 32) for the database snapshot.
statestringThe state of the database snapshot. (pattern: <code>.\S.</code>)
support_codestringThe support code for the database snapshot. Include this code in your email to support when you have questions about a database snapshot in Lightsail. This code enables our support team to look up your Lightsail information more easily.
tagsarrayThe tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_relational_database_snapshotselectregionReturns information about a specific database snapshot in Amazon Lightsail.
get_relational_database_snapshotsselectregionReturns information about all of your database snapshots in Amazon Lightsail.
create_relational_database_snapshotinsertregion, relationalDatabaseName, relationalDatabaseSnapshotNameCreates a snapshot of your database in Amazon Lightsail. You can use snapshots for backups, to make copies of a database, and to save data before deleting a database. The create relational database snapshot operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.
delete_relational_database_snapshotdeleteregionDeletes a database snapshot in Amazon Lightsail. The delete relational database snapshot operation supports tag-based access control via resource tags applied to the resource identified by relationalDatabaseName. For more information, see the Amazon Lightsail Developer Guide.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about a specific database snapshot in Amazon Lightsail.

SELECT
name,
arn,
created_at,
engine,
engine_version,
from_relational_database_arn,
from_relational_database_blueprint_id,
from_relational_database_bundle_id,
from_relational_database_name,
location,
resource_type,
size_in_gb,
state,
support_code,
tags
FROM aws.lightsail.relational_database_snapshots
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a snapshot of your database in Amazon Lightsail. You can use snapshots for backups, to make copies of a database, and to save data before deleting a database. The create relational database snapshot operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.

INSERT INTO aws.lightsail.relational_database_snapshots (
relationalDatabaseName,
relationalDatabaseSnapshotName,
tags,
region
)
SELECT
'{{ relationalDatabaseName }}' /* required */,
'{{ relationalDatabaseSnapshotName }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
operations
;

DELETE examples

Deletes a database snapshot in Amazon Lightsail. The delete relational database snapshot operation supports tag-based access control via resource tags applied to the resource identified by relationalDatabaseName. For more information, see the Amazon Lightsail Developer Guide.

DELETE FROM aws.lightsail.relational_database_snapshots
WHERE region = '{{ region }}' --required
;