AWS v6.73.0 published on Wednesday, Mar 19, 2025 by Pulumi
aws.rds.getClusterSnapshot
Explore with Pulumi AI
Use this data source to get information about a DB Cluster Snapshot for use when provisioning DB clusters.
NOTE: This data source does not apply to snapshots created on DB Instances. See the
aws.rds.Snapshotdata source for DB Instance snapshots.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const developmentFinalSnapshot = aws.rds.getClusterSnapshot({
    dbClusterIdentifier: "development_cluster",
    mostRecent: true,
});
// Use the last snapshot of the dev database before it was destroyed to create
// a new dev database.
const aurora = new aws.rds.Cluster("aurora", {
    clusterIdentifier: "development_cluster",
    snapshotIdentifier: developmentFinalSnapshot.then(developmentFinalSnapshot => developmentFinalSnapshot.id),
    dbSubnetGroupName: "my_db_subnet_group",
});
const auroraClusterInstance = new aws.rds.ClusterInstance("aurora", {
    clusterIdentifier: aurora.id,
    instanceClass: aws.rds.InstanceType.T2_Small,
    dbSubnetGroupName: "my_db_subnet_group",
});
import pulumi
import pulumi_aws as aws
development_final_snapshot = aws.rds.get_cluster_snapshot(db_cluster_identifier="development_cluster",
    most_recent=True)
# Use the last snapshot of the dev database before it was destroyed to create
# a new dev database.
aurora = aws.rds.Cluster("aurora",
    cluster_identifier="development_cluster",
    snapshot_identifier=development_final_snapshot.id,
    db_subnet_group_name="my_db_subnet_group")
aurora_cluster_instance = aws.rds.ClusterInstance("aurora",
    cluster_identifier=aurora.id,
    instance_class=aws.rds.InstanceType.T2_SMALL,
    db_subnet_group_name="my_db_subnet_group")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		developmentFinalSnapshot, err := rds.LookupClusterSnapshot(ctx, &rds.LookupClusterSnapshotArgs{
			DbClusterIdentifier: pulumi.StringRef("development_cluster"),
			MostRecent:          pulumi.BoolRef(true),
		}, nil)
		if err != nil {
			return err
		}
		// Use the last snapshot of the dev database before it was destroyed to create
		// a new dev database.
		aurora, err := rds.NewCluster(ctx, "aurora", &rds.ClusterArgs{
			ClusterIdentifier:  pulumi.String("development_cluster"),
			SnapshotIdentifier: pulumi.String(developmentFinalSnapshot.Id),
			DbSubnetGroupName:  pulumi.String("my_db_subnet_group"),
		})
		if err != nil {
			return err
		}
		_, err = rds.NewClusterInstance(ctx, "aurora", &rds.ClusterInstanceArgs{
			ClusterIdentifier: aurora.ID(),
			InstanceClass:     pulumi.String(rds.InstanceType_T2_Small),
			DbSubnetGroupName: pulumi.String("my_db_subnet_group"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var developmentFinalSnapshot = Aws.Rds.GetClusterSnapshot.Invoke(new()
    {
        DbClusterIdentifier = "development_cluster",
        MostRecent = true,
    });
    // Use the last snapshot of the dev database before it was destroyed to create
    // a new dev database.
    var aurora = new Aws.Rds.Cluster("aurora", new()
    {
        ClusterIdentifier = "development_cluster",
        SnapshotIdentifier = developmentFinalSnapshot.Apply(getClusterSnapshotResult => getClusterSnapshotResult.Id),
        DbSubnetGroupName = "my_db_subnet_group",
    });
    var auroraClusterInstance = new Aws.Rds.ClusterInstance("aurora", new()
    {
        ClusterIdentifier = aurora.Id,
        InstanceClass = Aws.Rds.InstanceType.T2_Small,
        DbSubnetGroupName = "my_db_subnet_group",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.RdsFunctions;
import com.pulumi.aws.rds.inputs.GetClusterSnapshotArgs;
import com.pulumi.aws.rds.Cluster;
import com.pulumi.aws.rds.ClusterArgs;
import com.pulumi.aws.rds.ClusterInstance;
import com.pulumi.aws.rds.ClusterInstanceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var developmentFinalSnapshot = RdsFunctions.getClusterSnapshot(GetClusterSnapshotArgs.builder()
            .dbClusterIdentifier("development_cluster")
            .mostRecent(true)
            .build());
        // Use the last snapshot of the dev database before it was destroyed to create
        // a new dev database.
        var aurora = new Cluster("aurora", ClusterArgs.builder()
            .clusterIdentifier("development_cluster")
            .snapshotIdentifier(developmentFinalSnapshot.applyValue(getClusterSnapshotResult -> getClusterSnapshotResult.id()))
            .dbSubnetGroupName("my_db_subnet_group")
            .build());
        var auroraClusterInstance = new ClusterInstance("auroraClusterInstance", ClusterInstanceArgs.builder()
            .clusterIdentifier(aurora.id())
            .instanceClass("db.t2.small")
            .dbSubnetGroupName("my_db_subnet_group")
            .build());
    }
}
resources:
  # Use the last snapshot of the dev database before it was destroyed to create
  # a new dev database.
  aurora:
    type: aws:rds:Cluster
    properties:
      clusterIdentifier: development_cluster
      snapshotIdentifier: ${developmentFinalSnapshot.id}
      dbSubnetGroupName: my_db_subnet_group
  auroraClusterInstance:
    type: aws:rds:ClusterInstance
    name: aurora
    properties:
      clusterIdentifier: ${aurora.id}
      instanceClass: db.t2.small
      dbSubnetGroupName: my_db_subnet_group
variables:
  developmentFinalSnapshot:
    fn::invoke:
      function: aws:rds:getClusterSnapshot
      arguments:
        dbClusterIdentifier: development_cluster
        mostRecent: true
Using getClusterSnapshot
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getClusterSnapshot(args: GetClusterSnapshotArgs, opts?: InvokeOptions): Promise<GetClusterSnapshotResult>
function getClusterSnapshotOutput(args: GetClusterSnapshotOutputArgs, opts?: InvokeOptions): Output<GetClusterSnapshotResult>def get_cluster_snapshot(db_cluster_identifier: Optional[str] = None,
                         db_cluster_snapshot_identifier: Optional[str] = None,
                         include_public: Optional[bool] = None,
                         include_shared: Optional[bool] = None,
                         most_recent: Optional[bool] = None,
                         snapshot_type: Optional[str] = None,
                         tags: Optional[Mapping[str, str]] = None,
                         opts: Optional[InvokeOptions] = None) -> GetClusterSnapshotResult
def get_cluster_snapshot_output(db_cluster_identifier: Optional[pulumi.Input[str]] = None,
                         db_cluster_snapshot_identifier: Optional[pulumi.Input[str]] = None,
                         include_public: Optional[pulumi.Input[bool]] = None,
                         include_shared: Optional[pulumi.Input[bool]] = None,
                         most_recent: Optional[pulumi.Input[bool]] = None,
                         snapshot_type: Optional[pulumi.Input[str]] = None,
                         tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetClusterSnapshotResult]func LookupClusterSnapshot(ctx *Context, args *LookupClusterSnapshotArgs, opts ...InvokeOption) (*LookupClusterSnapshotResult, error)
func LookupClusterSnapshotOutput(ctx *Context, args *LookupClusterSnapshotOutputArgs, opts ...InvokeOption) LookupClusterSnapshotResultOutput> Note: This function is named LookupClusterSnapshot in the Go SDK.
public static class GetClusterSnapshot 
{
    public static Task<GetClusterSnapshotResult> InvokeAsync(GetClusterSnapshotArgs args, InvokeOptions? opts = null)
    public static Output<GetClusterSnapshotResult> Invoke(GetClusterSnapshotInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetClusterSnapshotResult> getClusterSnapshot(GetClusterSnapshotArgs args, InvokeOptions options)
public static Output<GetClusterSnapshotResult> getClusterSnapshot(GetClusterSnapshotArgs args, InvokeOptions options)
fn::invoke:
  function: aws:rds/getClusterSnapshot:getClusterSnapshot
  arguments:
    # arguments dictionaryThe following arguments are supported:
- DbCluster stringIdentifier 
- Returns the list of snapshots created by the specific db_cluster
- DbCluster stringSnapshot Identifier 
- Returns information on a specific snapshot_id.
- IncludePublic bool
- Set this value to true to include manual DB Cluster Snapshots that are public and can be
copied or restored by any AWS account, otherwise set this value to false. The default is false.
- bool
- Set this value to true to include shared manual DB Cluster 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
- Type of snapshots to be returned. If you don't specify a SnapshotType
value, then both automated and manual DB cluster snapshots are returned. Shared and public DB Cluster Snapshots are not
included in the returned results by default. Possible values are, automated,manual,shared,publicandawsbackup.
- Dictionary<string, string>
- Mapping of tags, each pair of which must exactly match a pair on the desired DB cluster snapshot.
- DbCluster stringIdentifier 
- Returns the list of snapshots created by the specific db_cluster
- DbCluster stringSnapshot Identifier 
- Returns information on a specific snapshot_id.
- IncludePublic bool
- Set this value to true to include manual DB Cluster Snapshots that are public and can be
copied or restored by any AWS account, otherwise set this value to false. The default is false.
- bool
- Set this value to true to include shared manual DB Cluster 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
- Type of snapshots to be returned. If you don't specify a SnapshotType
value, then both automated and manual DB cluster snapshots are returned. Shared and public DB Cluster Snapshots are not
included in the returned results by default. Possible values are, automated,manual,shared,publicandawsbackup.
- map[string]string
- Mapping of tags, each pair of which must exactly match a pair on the desired DB cluster snapshot.
- dbCluster StringIdentifier 
- Returns the list of snapshots created by the specific db_cluster
- dbCluster StringSnapshot Identifier 
- Returns information on a specific snapshot_id.
- includePublic Boolean
- Set this value to true to include manual DB Cluster Snapshots that are public and can be
copied or restored by any AWS account, otherwise set this value to false. The default is false.
- Boolean
- Set this value to true to include shared manual DB Cluster 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
- Type of snapshots to be returned. If you don't specify a SnapshotType
value, then both automated and manual DB cluster snapshots are returned. Shared and public DB Cluster Snapshots are not
included in the returned results by default. Possible values are, automated,manual,shared,publicandawsbackup.
- Map<String,String>
- Mapping of tags, each pair of which must exactly match a pair on the desired DB cluster snapshot.
- dbCluster stringIdentifier 
- Returns the list of snapshots created by the specific db_cluster
- dbCluster stringSnapshot Identifier 
- Returns information on a specific snapshot_id.
- includePublic boolean
- Set this value to true to include manual DB Cluster Snapshots that are public and can be
copied or restored by any AWS account, otherwise set this value to false. The default is false.
- boolean
- Set this value to true to include shared manual DB Cluster 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
- Type of snapshots to be returned. If you don't specify a SnapshotType
value, then both automated and manual DB cluster snapshots are returned. Shared and public DB Cluster Snapshots are not
included in the returned results by default. Possible values are, automated,manual,shared,publicandawsbackup.
- {[key: string]: string}
- Mapping of tags, each pair of which must exactly match a pair on the desired DB cluster snapshot.
- db_cluster_ stridentifier 
- Returns the list of snapshots created by the specific db_cluster
- db_cluster_ strsnapshot_ identifier 
- Returns information on a specific snapshot_id.
- include_public bool
- Set this value to true to include manual DB Cluster Snapshots that are public and can be
copied or restored by any AWS account, otherwise set this value to false. The default is false.
- bool
- Set this value to true to include shared manual DB Cluster 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
- Type of snapshots to be returned. If you don't specify a SnapshotType
value, then both automated and manual DB cluster snapshots are returned. Shared and public DB Cluster Snapshots are not
included in the returned results by default. Possible values are, automated,manual,shared,publicandawsbackup.
- Mapping[str, str]
- Mapping of tags, each pair of which must exactly match a pair on the desired DB cluster snapshot.
- dbCluster StringIdentifier 
- Returns the list of snapshots created by the specific db_cluster
- dbCluster StringSnapshot Identifier 
- Returns information on a specific snapshot_id.
- includePublic Boolean
- Set this value to true to include manual DB Cluster Snapshots that are public and can be
copied or restored by any AWS account, otherwise set this value to false. The default is false.
- Boolean
- Set this value to true to include shared manual DB Cluster 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
- Type of snapshots to be returned. If you don't specify a SnapshotType
value, then both automated and manual DB cluster snapshots are returned. Shared and public DB Cluster Snapshots are not
included in the returned results by default. Possible values are, automated,manual,shared,publicandawsbackup.
- Map<String>
- Mapping of tags, each pair of which must exactly match a pair on the desired DB cluster snapshot.
getClusterSnapshot Result
The following output properties are available:
- AllocatedStorage int
- Allocated storage size in gigabytes (GB).
- AvailabilityZones List<string>
- List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in.
- DbCluster stringSnapshot Arn 
- The ARN for the DB Cluster Snapshot.
- Engine string
- Name of the database engine.
- EngineVersion string
- Version of the database engine for this DB cluster snapshot.
- Id string
- The provider-assigned unique ID for this managed resource.
- KmsKey stringId 
- If storage_encrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot.
- LicenseModel string
- License model information for the restored DB cluster.
- Port int
- Port that the DB cluster was listening on at the time of the snapshot.
- SnapshotCreate stringTime 
- Time when the snapshot was taken, in Universal Coordinated Time (UTC).
- SourceDb stringCluster Snapshot Arn 
- Status string
- Status of this DB Cluster Snapshot.
- StorageEncrypted bool
- Whether the DB cluster snapshot is encrypted.
- Dictionary<string, string>
- Map of tags for the resource.
- VpcId string
- VPC ID associated with the DB cluster snapshot.
- DbCluster stringIdentifier 
- Specifies the DB cluster identifier of the DB cluster that this DB cluster snapshot was created from.
- DbCluster stringSnapshot Identifier 
- IncludePublic bool
- bool
- MostRecent bool
- SnapshotType string
- AllocatedStorage int
- Allocated storage size in gigabytes (GB).
- AvailabilityZones []string
- List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in.
- DbCluster stringSnapshot Arn 
- The ARN for the DB Cluster Snapshot.
- Engine string
- Name of the database engine.
- EngineVersion string
- Version of the database engine for this DB cluster snapshot.
- Id string
- The provider-assigned unique ID for this managed resource.
- KmsKey stringId 
- If storage_encrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot.
- LicenseModel string
- License model information for the restored DB cluster.
- Port int
- Port that the DB cluster was listening on at the time of the snapshot.
- SnapshotCreate stringTime 
- Time when the snapshot was taken, in Universal Coordinated Time (UTC).
- SourceDb stringCluster Snapshot Arn 
- Status string
- Status of this DB Cluster Snapshot.
- StorageEncrypted bool
- Whether the DB cluster snapshot is encrypted.
- map[string]string
- Map of tags for the resource.
- VpcId string
- VPC ID associated with the DB cluster snapshot.
- DbCluster stringIdentifier 
- Specifies the DB cluster identifier of the DB cluster that this DB cluster snapshot was created from.
- DbCluster stringSnapshot Identifier 
- IncludePublic bool
- bool
- MostRecent bool
- SnapshotType string
- allocatedStorage Integer
- Allocated storage size in gigabytes (GB).
- availabilityZones List<String>
- List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in.
- dbCluster StringSnapshot Arn 
- The ARN for the DB Cluster Snapshot.
- engine String
- Name of the database engine.
- engineVersion String
- Version of the database engine for this DB cluster snapshot.
- id String
- The provider-assigned unique ID for this managed resource.
- kmsKey StringId 
- If storage_encrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot.
- licenseModel String
- License model information for the restored DB cluster.
- port Integer
- Port that the DB cluster was listening on at the time of the snapshot.
- snapshotCreate StringTime 
- Time when the snapshot was taken, in Universal Coordinated Time (UTC).
- sourceDb StringCluster Snapshot Arn 
- status String
- Status of this DB Cluster Snapshot.
- storageEncrypted Boolean
- Whether the DB cluster snapshot is encrypted.
- Map<String,String>
- Map of tags for the resource.
- vpcId String
- VPC ID associated with the DB cluster snapshot.
- dbCluster StringIdentifier 
- Specifies the DB cluster identifier of the DB cluster that this DB cluster snapshot was created from.
- dbCluster StringSnapshot Identifier 
- includePublic Boolean
- Boolean
- mostRecent Boolean
- snapshotType String
- allocatedStorage number
- Allocated storage size in gigabytes (GB).
- availabilityZones string[]
- List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in.
- dbCluster stringSnapshot Arn 
- The ARN for the DB Cluster Snapshot.
- engine string
- Name of the database engine.
- engineVersion string
- Version of the database engine for this DB cluster snapshot.
- id string
- The provider-assigned unique ID for this managed resource.
- kmsKey stringId 
- If storage_encrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot.
- licenseModel string
- License model information for the restored DB cluster.
- port number
- Port that the DB cluster was listening on at the time of the snapshot.
- snapshotCreate stringTime 
- Time when the snapshot was taken, in Universal Coordinated Time (UTC).
- sourceDb stringCluster Snapshot Arn 
- status string
- Status of this DB Cluster Snapshot.
- storageEncrypted boolean
- Whether the DB cluster snapshot is encrypted.
- {[key: string]: string}
- Map of tags for the resource.
- vpcId string
- VPC ID associated with the DB cluster snapshot.
- dbCluster stringIdentifier 
- Specifies the DB cluster identifier of the DB cluster that this DB cluster snapshot was created from.
- dbCluster stringSnapshot Identifier 
- includePublic boolean
- boolean
- mostRecent boolean
- snapshotType string
- allocated_storage int
- Allocated storage size in gigabytes (GB).
- availability_zones Sequence[str]
- List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in.
- db_cluster_ strsnapshot_ arn 
- The ARN for the DB Cluster Snapshot.
- engine str
- Name of the database engine.
- engine_version str
- Version of the database engine for this DB cluster snapshot.
- id str
- The provider-assigned unique ID for this managed resource.
- kms_key_ strid 
- If storage_encrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot.
- license_model str
- License model information for the restored DB cluster.
- port int
- Port that the DB cluster was listening on at the time of the snapshot.
- snapshot_create_ strtime 
- Time when the snapshot was taken, in Universal Coordinated Time (UTC).
- source_db_ strcluster_ snapshot_ arn 
- status str
- Status of this DB Cluster Snapshot.
- storage_encrypted bool
- Whether the DB cluster snapshot is encrypted.
- Mapping[str, str]
- Map of tags for the resource.
- vpc_id str
- VPC ID associated with the DB cluster snapshot.
- db_cluster_ stridentifier 
- Specifies the DB cluster identifier of the DB cluster that this DB cluster snapshot was created from.
- db_cluster_ strsnapshot_ identifier 
- include_public bool
- bool
- most_recent bool
- snapshot_type str
- allocatedStorage Number
- Allocated storage size in gigabytes (GB).
- availabilityZones List<String>
- List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in.
- dbCluster StringSnapshot Arn 
- The ARN for the DB Cluster Snapshot.
- engine String
- Name of the database engine.
- engineVersion String
- Version of the database engine for this DB cluster snapshot.
- id String
- The provider-assigned unique ID for this managed resource.
- kmsKey StringId 
- If storage_encrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot.
- licenseModel String
- License model information for the restored DB cluster.
- port Number
- Port that the DB cluster was listening on at the time of the snapshot.
- snapshotCreate StringTime 
- Time when the snapshot was taken, in Universal Coordinated Time (UTC).
- sourceDb StringCluster Snapshot Arn 
- status String
- Status of this DB Cluster Snapshot.
- storageEncrypted Boolean
- Whether the DB cluster snapshot is encrypted.
- Map<String>
- Map of tags for the resource.
- vpcId String
- VPC ID associated with the DB cluster snapshot.
- dbCluster StringIdentifier 
- Specifies the DB cluster identifier of the DB cluster that this DB cluster snapshot was created from.
- dbCluster StringSnapshot Identifier 
- includePublic Boolean
- Boolean
- mostRecent Boolean
- snapshotType String
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.