db_snapshots
Creates, updates, deletes, gets or lists a db_snapshots resource.
Overview
| Name | db_snapshots |
| Type | Resource |
| Id | aws.rds.db_snapshots |
Fields
The following fields are returned by SELECT queries:
- describe_db_snapshots
| Name | Datatype | Description |
|---|---|---|
additional_storage_volumes | string | The additional storage volumes associated with the DB snapshot. RDS supports additional storage volumes for RDS for Oracle and RDS for SQL Server. |
allocated_storage | integer | Specifies the allocated storage size in gibibytes (GiB). |
availability_zone | string | Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot. |
backup_retention_period | integer | The number of days for which automatic DB snapshots are retained. |
db_instance_identifier | string | Specifies the DB instance identifier of the DB instance this DB snapshot was created from. |
db_snapshot_arn | string | The Amazon Resource Name (ARN) for the DB snapshot. |
db_snapshot_identifier | string | Specifies the identifier for the DB snapshot. |
db_system_id | string | The Oracle system identifier (SID), which is the name of the Oracle database instance that manages your database files. The Oracle SID is also the name of your CDB. |
dbi_resource_id | string | The identifier for the source DB instance, which can't be changed and which is unique to an Amazon Web Services Region. |
dedicated_log_volume | boolean | Indicates whether the DB instance has a dedicated log volume (DLV) enabled. |
encrypted | boolean | Indicates whether the DB snapshot is encrypted. |
engine | string | Specifies the name of the database engine. |
engine_version | string | Specifies the version of the database engine. |
iam_database_authentication_enabled | boolean | Indicates whether mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database accounts is enabled. |
instance_create_time | string | Specifies the time in Coordinated Universal Time (UTC) when the DB instance, from which the snapshot was taken, was created. |
iops | integer | Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot. |
kms_key_id | string | If Encrypted is true, the Amazon Web Services KMS key identifier for the encrypted DB snapshot. The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. |
license_model | string | License model information for the restored DB instance. |
master_username | string | Provides the master username for the DB snapshot. |
multi_tenant | boolean | Indicates whether the snapshot is of a DB instance using the multi-tenant configuration (TRUE) or the single-tenant configuration (FALSE). |
option_group_name | string | Provides the option group name for the DB snapshot. |
original_snapshot_create_time | string | Specifies the time of the CreateDBSnapshot operation in Coordinated Universal Time (UTC). Doesn't change when the snapshot is copied. |
percent_progress | integer | The percentage of the estimated data that has been transferred. |
port | integer | Specifies the port that the database engine was listening on at the time of the snapshot. |
preferred_backup_window | string | The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod. |
processor_features | string | The number of CPU cores and the number of threads per core for the DB instance class of the DB instance when the DB snapshot was created. |
snapshot_availability_zone | string | Specifies the name of the Availability Zone where RDS stores the DB snapshot. This value is valid only for snapshots that RDS stores on a Dedicated Local Zone. |
snapshot_create_time | string | Specifies when the snapshot was taken in Coordinated Universal Time (UTC). Changes for the copy when the snapshot is copied. |
snapshot_database_time | string | The timestamp of the most recent transaction applied to the database that you're backing up. Thus, if you restore a snapshot, SnapshotDatabaseTime is the most recent transaction in the restored DB instance. In contrast, originalSnapshotCreateTime specifies the system time that the snapshot completed. If you back up a read replica, you can determine the replica lag by comparing SnapshotDatabaseTime with originalSnapshotCreateTime. For example, if originalSnapshotCreateTime is two hours later than SnapshotDatabaseTime, then the replica lag is two hours. |
snapshot_target | string | Specifies where manual snapshots are stored: Dedicated Local Zones, Amazon Web Services Outposts or the Amazon Web Services Region. |
snapshot_type | string | Provides the type of the DB snapshot. |
source_db_snapshot_identifier | string | The DB snapshot Amazon Resource Name (ARN) that the DB snapshot was copied from. It only has a value in the case of a cross-account or cross-Region copy. |
source_region | string | The Amazon Web Services Region that the DB snapshot was created in or copied from. |
status | string | Specifies the status of this DB snapshot. |
storage_encryption_type | string | The type of encryption used to protect data at rest in the DB snapshot. Possible values: none - The DB snapshot is not encrypted. sse-rds - The DB snapshot is encrypted using an Amazon Web Services owned KMS key. sse-kms - The DB snapshot is encrypted using a customer managed KMS key or Amazon Web Services managed KMS key. |
storage_throughput | integer | Specifies the storage throughput for the DB snapshot. |
storage_type | string | Specifies the storage type associated with DB snapshot. |
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. |
tde_credential_arn | string | The ARN from the key store with which to associate the instance for TDE encryption. |
timezone | string | The time zone of the DB snapshot. In most cases, the Timezone element is empty. Timezone content appears only for snapshots taken from Microsoft SQL Server DB instances that were created with a time zone specified. |
vpc_id | string | Provides the VPC ID associated with the DB snapshot. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_db_snapshots | select | region | DBInstanceIdentifier, DBSnapshotIdentifier, SnapshotType, Filters, MaxRecords, Marker, IncludeShared, IncludePublic, DbiResourceId | Returns information about DB snapshots. This API action supports pagination. |
create_db_snapshot | insert | DBSnapshotIdentifier, DBInstanceIdentifier, region | Tags | Creates a snapshot of a DB instance. The source DB instance must be in the available or storage-optimization state. |
modify_db_snapshot | update | DBSnapshotIdentifier, region | EngineVersion, OptionGroupName | Updates a manual DB snapshot with a new engine version. The snapshot can be encrypted or unencrypted, but not shared or public. Amazon RDS supports upgrading DB snapshots for MariaDB, MySQL, PostgreSQL, and Oracle. This operation doesn't apply to RDS Custom or RDS for Db2. |
delete_db_snapshot | delete | DBSnapshotIdentifier, region | Deletes a DB snapshot. If the snapshot is being copied, the copy operation is terminated. The DB snapshot must be in the available state to be deleted. |
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 identifier of the DB instance that you want to create the snapshot of. Constraints: Must match the identifier of an existing DBInstance. |
DBSnapshotIdentifier | string | The DB snapshot identifier. Constraints: Must be the name of an existing DB snapshot in the available state. |
region | string | AWS region (default: us-east-1) |
DBInstanceIdentifier | string | The ID of the DB instance to retrieve the list of DB snapshots for. This parameter isn't case-sensitive. Constraints: If supplied, must match the identifier of an existing DBInstance. |
DBSnapshotIdentifier | string | A specific DB snapshot identifier to describe. This value is stored as a lowercase string. Constraints: If supplied, must match the identifier of an existing DBSnapshot. If this identifier is for an automated snapshot, the SnapshotType parameter must also be specified. |
DbiResourceId | string | A specific DB resource ID to describe. |
EngineVersion | string | The engine version to upgrade the DB snapshot to. The following are the database engines and engine versions that are available when you upgrade a DB snapshot. MariaDB For the list of engine versions that are available for upgrading a DB snapshot, see Upgrading a MariaDB DB snapshot engine version in the Amazon RDS User Guide. MySQL For the list of engine versions that are available for upgrading a DB snapshot, see Upgrading a MySQL DB snapshot engine version in the Amazon RDS User Guide. Oracle 21.0.0.0.ru-2025-04.rur-2025-04.r1 (supported for 21.0.0.0.ru-2022-01.rur-2022-01.r1, 21.0.0.0.ru-2022-04.rur-2022-04.r1, 21.0.0.0.ru-2022-07.rur-2022-07.r1, 21.0.0.0.ru-2022-10.rur-2022-10.r1, 21.0.0.0.ru-2023-01.rur-2023-01.r1 and 21.0.0.0.ru-2023-01.rur-2023-01.r2 DB snapshots) 19.0.0.0.ru-2025-04.rur-2025-04.r1 (supported for 19.0.0.0.ru-2019-07.rur-2019-07.r1, 19.0.0.0.ru-2019-10.rur-2019-10.r1 and 0.0.0.ru-2020-01.rur-2020-01.r1 DB snapshots) 19.0.0.0.ru-2022-01.rur-2022-01.r1 (supported for 12.2.0.1 DB snapshots) 19.0.0.0.ru-2022-07.rur-2022-07.r1 (supported for 12.1.0.2 DB snapshots) 12.1.0.2.v8 (supported for 12.1.0.1 DB snapshots) 11.2.0.4.v12 (supported for 11.2.0.2 DB snapshots) 11.2.0.4.v11 (supported for 11.2.0.3 DB snapshots) PostgreSQL For the list of engine versions that are available for upgrading a DB snapshot, see Upgrading a PostgreSQL DB snapshot engine version in the Amazon RDS User Guide. |
Filters | array | A filter that specifies one or more DB snapshots to describe. Supported filters: db-instance-id - Accepts DB instance identifiers and DB instance Amazon Resource Names (ARNs). db-snapshot-id - Accepts DB snapshot identifiers. dbi-resource-id - Accepts identifiers of source DB instances. snapshot-type - Accepts types of DB snapshots. engine - Accepts names of database engines. |
IncludePublic | boolean | Specifies whether to include manual DB cluster snapshots that are public and can be copied or restored by any Amazon Web Services account. By default, the public snapshots are not included. You can share a manual DB snapshot as public by using the ModifyDBSnapshotAttribute API. This setting doesn't apply to RDS Custom. |
IncludeShared | boolean | Specifies whether to include shared manual DB cluster snapshots from other Amazon Web Services accounts that this Amazon Web Services account has been given permission to copy or restore. By default, these snapshots are not included. You can give an Amazon Web Services account permission to restore a manual DB snapshot from another Amazon Web Services account by using the ModifyDBSnapshotAttribute API action. This setting doesn't apply to RDS Custom. |
Marker | string | An optional pagination token provided by a previous DescribeDBSnapshots request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords. |
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. Default: 100 Constraints: Minimum 20, maximum 100. |
OptionGroupName | string | The option group to identify with the upgraded DB snapshot. You can specify this parameter when you upgrade an Oracle DB snapshot. The same option group considerations apply when upgrading a DB snapshot as when upgrading a DB instance. For more information, see Option group considerations in the Amazon RDS User Guide. |
SnapshotType | string | The type of snapshots to be returned. You can specify one of the following values: automated - Return all DB snapshots that have been automatically taken by Amazon RDS for my Amazon Web Services account. manual - Return all DB snapshots that have been taken by my Amazon Web Services account. shared - Return all manual DB snapshots that have been shared to my Amazon Web Services account. public - Return all DB snapshots that have been marked as public. awsbackup - Return the DB snapshots managed by the Amazon Web Services Backup service. For information about Amazon Web Services Backup, see the Amazon Web Services Backup Developer Guide. The awsbackup type does not apply to Aurora. If you don't specify a SnapshotType value, then both automated and manual snapshots are returned. Shared and public DB snapshots are not included in the returned results by default. You can include shared snapshots with these results by enabling the IncludeShared parameter. You can include public snapshots with these results by enabling the IncludePublic parameter. The IncludeShared and IncludePublic parameters don't apply for SnapshotType values of manual or automated. The IncludePublic parameter doesn't apply when SnapshotType is set to shared. The IncludeShared parameter doesn't apply when SnapshotType is set to public. |
Tags | array |
SELECT examples
- describe_db_snapshots
Returns information about DB snapshots. This API action supports pagination.
SELECT
additional_storage_volumes,
allocated_storage,
availability_zone,
backup_retention_period,
db_instance_identifier,
db_snapshot_arn,
db_snapshot_identifier,
db_system_id,
dbi_resource_id,
dedicated_log_volume,
encrypted,
engine,
engine_version,
iam_database_authentication_enabled,
instance_create_time,
iops,
kms_key_id,
license_model,
master_username,
multi_tenant,
option_group_name,
original_snapshot_create_time,
percent_progress,
port,
preferred_backup_window,
processor_features,
snapshot_availability_zone,
snapshot_create_time,
snapshot_database_time,
snapshot_target,
snapshot_type,
source_db_snapshot_identifier,
source_region,
status,
storage_encryption_type,
storage_throughput,
storage_type,
tag_list,
tde_credential_arn,
timezone,
vpc_id
FROM aws.rds.db_snapshots
WHERE region = '{{ region }}' -- required
AND DBInstanceIdentifier = '{{ DBInstanceIdentifier }}'
AND DBSnapshotIdentifier = '{{ DBSnapshotIdentifier }}'
AND SnapshotType = '{{ SnapshotType }}'
AND Filters = '{{ Filters }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
AND IncludeShared = '{{ IncludeShared }}'
AND IncludePublic = '{{ IncludePublic }}'
AND DbiResourceId = '{{ DbiResourceId }}'
;
INSERT examples
- create_db_snapshot
- Manifest
Creates a snapshot of a DB instance. The source DB instance must be in the available or storage-optimization state.
INSERT INTO aws.rds.db_snapshots (
DBSnapshotIdentifier,
DBInstanceIdentifier,
region,
Tags
)
SELECT
'{{ DBSnapshotIdentifier }}',
'{{ DBInstanceIdentifier }}',
'{{ region }}',
'{{ Tags }}'
RETURNING
additional_storage_volumes,
allocated_storage,
availability_zone,
backup_retention_period,
db_instance_identifier,
db_snapshot_arn,
db_snapshot_identifier,
db_system_id,
dbi_resource_id,
dedicated_log_volume,
encrypted,
engine,
engine_version,
iam_database_authentication_enabled,
instance_create_time,
iops,
kms_key_id,
license_model,
master_username,
multi_tenant,
option_group_name,
original_snapshot_create_time,
percent_progress,
port,
preferred_backup_window,
processor_features,
snapshot_availability_zone,
snapshot_create_time,
snapshot_database_time,
snapshot_target,
snapshot_type,
source_db_snapshot_identifier,
source_region,
status,
storage_encryption_type,
storage_throughput,
storage_type,
tag_list,
tde_credential_arn,
timezone,
vpc_id
;
# Description fields are for documentation purposes
- name: db_snapshots
props:
- name: DBSnapshotIdentifier
value: "{{ DBSnapshotIdentifier }}"
description: Required parameter for the db_snapshots resource.
- name: DBInstanceIdentifier
value: "{{ DBInstanceIdentifier }}"
description: Required parameter for the db_snapshots resource.
- name: region
value: "{{ region }}"
description: Required parameter for the db_snapshots resource.
- name: Tags
value: "{{ Tags }}"
UPDATE examples
- modify_db_snapshot
Updates a manual DB snapshot with a new engine version. The snapshot can be encrypted or unencrypted, but not shared or public. Amazon RDS supports upgrading DB snapshots for MariaDB, MySQL, PostgreSQL, and Oracle. This operation doesn't apply to RDS Custom or RDS for Db2.
UPDATE aws.rds.db_snapshots
SET
-- No updatable properties
WHERE
DBSnapshotIdentifier = '{{ DBSnapshotIdentifier }}' --required
AND region = '{{ region }}' --required
AND EngineVersion = '{{ EngineVersion}}'
AND OptionGroupName = '{{ OptionGroupName}}'
RETURNING
additional_storage_volumes,
allocated_storage,
availability_zone,
backup_retention_period,
db_instance_identifier,
db_snapshot_arn,
db_snapshot_identifier,
db_system_id,
dbi_resource_id,
dedicated_log_volume,
encrypted,
engine,
engine_version,
iam_database_authentication_enabled,
instance_create_time,
iops,
kms_key_id,
license_model,
master_username,
multi_tenant,
option_group_name,
original_snapshot_create_time,
percent_progress,
port,
preferred_backup_window,
processor_features,
snapshot_availability_zone,
snapshot_create_time,
snapshot_database_time,
snapshot_target,
snapshot_type,
source_db_snapshot_identifier,
source_region,
status,
storage_encryption_type,
storage_throughput,
storage_type,
tag_list,
tde_credential_arn,
timezone,
vpc_id;
DELETE examples
- delete_db_snapshot
Deletes a DB snapshot. If the snapshot is being copied, the copy operation is terminated. The DB snapshot must be in the available state to be deleted.
DELETE FROM aws.rds.db_snapshots
WHERE DBSnapshotIdentifier = '{{ DBSnapshotIdentifier }}' --required
AND region = '{{ region }}' --required
;