GetSnapshot

Use this data source to get information about a DB Snapshot for use when provisioning DB instances

NOTE: This data source does not apply to snapshots created on Aurora DB clusters. See the aws.rds.ClusterSnapshot data source for DB Cluster snapshots.

Example Usage

Coming soon!

Coming soon!

import pulumi
import pulumi_aws as aws

prod = aws.rds.Instance("prod",
    allocated_storage=10,
    db_subnet_group_name="my_database_subnet_group",
    engine="mysql",
    engine_version="5.6.17",
    instance_class="db.t2.micro",
    name="mydb",
    parameter_group_name="default.mysql5.6",
    password="bar",
    username="foo")
latest_prod_snapshot = prod.id.apply(lambda id: aws.rds.get_snapshot(db_instance_identifier=id,
    most_recent=True))
# Use the latest production snapshot to create a dev instance.
dev = aws.rds.Instance("dev",
    instance_class="db.t2.micro",
    lifecycle={
        "ignoreChanges": ["snapshotIdentifier"],
    },
    name="mydbdev",
    snapshot_identifier=latest_prod_snapshot.id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const prod = new aws.rds.Instance("prod", {
    allocatedStorage: 10,
    dbSubnetGroupName: "my_database_subnet_group",
    engine: "mysql",
    engineVersion: "5.6.17",
    instanceClass: "db.t2.micro",
    name: "mydb",
    parameterGroupName: "default.mysql5.6",
    password: "bar",
    username: "foo",
});
const latestProdSnapshot = prod.id.apply(id => aws.rds.getSnapshot({
    dbInstanceIdentifier: id,
    mostRecent: true,
}, { async: true }));
// Use the latest production snapshot to create a dev instance.
const dev = new aws.rds.Instance("dev", {
    instanceClass: "db.t2.micro",
    name: "mydbdev",
    snapshotIdentifier: latestProdSnapshot.id,
}, { ignoreChanges: ["snapshotIdentifier"] });

Using GetSnapshot

function getSnapshot(args: GetSnapshotArgs, opts?: InvokeOptions): Promise<GetSnapshotResult>
function  get_snapshot(db_instance_identifier=None, db_snapshot_identifier=None, include_public=None, include_shared=None, most_recent=None, snapshot_type=None, opts=None)
func LookupSnapshot(ctx *Context, args *LookupSnapshotArgs, opts ...InvokeOption) (*LookupSnapshotResult, error)

Note: This function is named LookupSnapshot in the Go SDK.

public static class GetSnapshot {
    public static Task<GetSnapshotResult> InvokeAsync(GetSnapshotArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

DbInstanceIdentifier string

Returns the list of snapshots created by the specific db_instance

DbSnapshotIdentifier string

Returns information on a specific snapshot_id.

IncludePublic bool

Set this value to true to include manual DB snapshots that are public and can be copied or restored by any AWS account, otherwise set this value to false. The default is false.

IncludeShared bool

Set this value to true to include shared manual DB snapshots from other AWS accounts that this AWS account has been given permission to copy or restore, otherwise set this value to false. The default is false.

MostRecent bool

If more than one result is returned, use the most recent Snapshot.

SnapshotType string

The type of snapshots to be returned. 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. Possible values are, automated, manual, shared and public.

DbInstanceIdentifier string

Returns the list of snapshots created by the specific db_instance

DbSnapshotIdentifier string

Returns information on a specific snapshot_id.

IncludePublic bool

Set this value to true to include manual DB snapshots that are public and can be copied or restored by any AWS account, otherwise set this value to false. The default is false.

IncludeShared bool

Set this value to true to include shared manual DB snapshots from other AWS accounts that this AWS account has been given permission to copy or restore, otherwise set this value to false. The default is false.

MostRecent bool

If more than one result is returned, use the most recent Snapshot.

SnapshotType string

The type of snapshots to be returned. 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. Possible values are, automated, manual, shared and public.

dbInstanceIdentifier string

Returns the list of snapshots created by the specific db_instance

dbSnapshotIdentifier string

Returns information on a specific snapshot_id.

includePublic boolean

Set this value to true to include manual DB snapshots that are public and can be copied or restored by any AWS account, otherwise set this value to false. The default is false.

includeShared boolean

Set this value to true to include shared manual DB snapshots from other AWS accounts that this AWS account has been given permission to copy or restore, otherwise set this value to false. The default is false.

mostRecent boolean

If more than one result is returned, use the most recent Snapshot.

snapshotType string

The type of snapshots to be returned. 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. Possible values are, automated, manual, shared and public.

db_instance_identifier str

Returns the list of snapshots created by the specific db_instance

db_snapshot_identifier str

Returns information on a specific snapshot_id.

include_public bool

Set this value to true to include manual DB snapshots that are public and can be copied or restored by any AWS account, otherwise set this value to false. The default is false.

include_shared bool

Set this value to true to include shared manual DB snapshots from other AWS accounts that this AWS account has been given permission to copy or restore, otherwise set this value to false. The default is false.

most_recent bool

If more than one result is returned, use the most recent Snapshot.

snapshot_type str

The type of snapshots to be returned. 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. Possible values are, automated, manual, shared and public.

GetSnapshot Result

The following output properties are available:

AllocatedStorage int

Specifies the allocated storage size in gigabytes (GB).

AvailabilityZone string

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

DbSnapshotArn string

The Amazon Resource Name (ARN) for the DB snapshot.

Encrypted bool

Specifies whether the DB snapshot is encrypted.

Engine string

Specifies the name of the database engine.

EngineVersion string

Specifies the version of the database engine.

Id string

The provider-assigned unique ID for this managed resource.

Iops int

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

KmsKeyId string

The ARN for the KMS encryption key.

LicenseModel string

License model information for the restored DB instance.

OptionGroupName string

Provides the option group name for the DB snapshot.

Port int
SnapshotCreateTime string

Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC).

SourceDbSnapshotIdentifier string

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

SourceRegion string

The region that the DB snapshot was created in or copied from.

Status string

Specifies the status of this DB snapshot.

StorageType string

Specifies the storage type associated with DB snapshot.

VpcId string

Specifies the ID of the VPC associated with the DB snapshot.

DbInstanceIdentifier string
DbSnapshotIdentifier string
IncludePublic bool
IncludeShared bool
MostRecent bool
SnapshotType string
AllocatedStorage int

Specifies the allocated storage size in gigabytes (GB).

AvailabilityZone string

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

DbSnapshotArn string

The Amazon Resource Name (ARN) for the DB snapshot.

Encrypted bool

Specifies whether the DB snapshot is encrypted.

Engine string

Specifies the name of the database engine.

EngineVersion string

Specifies the version of the database engine.

Id string

The provider-assigned unique ID for this managed resource.

Iops int

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

KmsKeyId string

The ARN for the KMS encryption key.

LicenseModel string

License model information for the restored DB instance.

OptionGroupName string

Provides the option group name for the DB snapshot.

Port int
SnapshotCreateTime string

Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC).

SourceDbSnapshotIdentifier string

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

SourceRegion string

The region that the DB snapshot was created in or copied from.

Status string

Specifies the status of this DB snapshot.

StorageType string

Specifies the storage type associated with DB snapshot.

VpcId string

Specifies the ID of the VPC associated with the DB snapshot.

DbInstanceIdentifier string
DbSnapshotIdentifier string
IncludePublic bool
IncludeShared bool
MostRecent bool
SnapshotType string
allocatedStorage number

Specifies the allocated storage size in gigabytes (GB).

availabilityZone string

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

dbSnapshotArn string

The Amazon Resource Name (ARN) for the DB snapshot.

encrypted boolean

Specifies whether the DB snapshot is encrypted.

engine string

Specifies the name of the database engine.

engineVersion string

Specifies the version of the database engine.

id string

The provider-assigned unique ID for this managed resource.

iops number

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

kmsKeyId string

The ARN for the KMS encryption key.

licenseModel string

License model information for the restored DB instance.

optionGroupName string

Provides the option group name for the DB snapshot.

port number
snapshotCreateTime string

Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC).

sourceDbSnapshotIdentifier string

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

sourceRegion string

The region that the DB snapshot was created in or copied from.

status string

Specifies the status of this DB snapshot.

storageType string

Specifies the storage type associated with DB snapshot.

vpcId string

Specifies the ID of the VPC associated with the DB snapshot.

dbInstanceIdentifier string
dbSnapshotIdentifier string
includePublic boolean
includeShared boolean
mostRecent boolean
snapshotType string
allocated_storage float

Specifies the allocated storage size in gigabytes (GB).

availability_zone str

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

db_snapshot_arn str

The Amazon Resource Name (ARN) for the DB snapshot.

encrypted bool

Specifies whether the DB snapshot is encrypted.

engine str

Specifies the name of the database engine.

engine_version str

Specifies the version of the database engine.

id str

The provider-assigned unique ID for this managed resource.

iops float

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

kms_key_id str

The ARN for the KMS encryption key.

license_model str

License model information for the restored DB instance.

option_group_name str

Provides the option group name for the DB snapshot.

port float
snapshot_create_time str

Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC).

source_db_snapshot_identifier str

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

source_region str

The region that the DB snapshot was created in or copied from.

status str

Specifies the status of this DB snapshot.

storage_type str

Specifies the storage type associated with DB snapshot.

vpc_id str

Specifies the ID of the VPC associated with the DB snapshot.

db_instance_identifier str
db_snapshot_identifier str
include_public bool
include_shared bool
most_recent bool
snapshot_type str

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.