1. Packages
  2. AWS
  3. API Docs
  4. docdb
  5. ClusterSnapshot
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.docdb.ClusterSnapshot

Explore with Pulumi AI

Manages a DocumentDB database cluster snapshot for DocumentDB clusters.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.docdb.ClusterSnapshot("example", {
    dbClusterIdentifier: exampleAwsDocdbCluster.id,
    dbClusterSnapshotIdentifier: "resourcetestsnapshot1234",
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.docdb.ClusterSnapshot("example",
    db_cluster_identifier=example_aws_docdb_cluster["id"],
    db_cluster_snapshot_identifier="resourcetestsnapshot1234")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/docdb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := docdb.NewClusterSnapshot(ctx, "example", &docdb.ClusterSnapshotArgs{
			DbClusterIdentifier:         pulumi.Any(exampleAwsDocdbCluster.Id),
			DbClusterSnapshotIdentifier: pulumi.String("resourcetestsnapshot1234"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.DocDB.ClusterSnapshot("example", new()
    {
        DbClusterIdentifier = exampleAwsDocdbCluster.Id,
        DbClusterSnapshotIdentifier = "resourcetestsnapshot1234",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.docdb.ClusterSnapshot;
import com.pulumi.aws.docdb.ClusterSnapshotArgs;
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) {
        var example = new ClusterSnapshot("example", ClusterSnapshotArgs.builder()
            .dbClusterIdentifier(exampleAwsDocdbCluster.id())
            .dbClusterSnapshotIdentifier("resourcetestsnapshot1234")
            .build());

    }
}
Copy
resources:
  example:
    type: aws:docdb:ClusterSnapshot
    properties:
      dbClusterIdentifier: ${exampleAwsDocdbCluster.id}
      dbClusterSnapshotIdentifier: resourcetestsnapshot1234
Copy

Create ClusterSnapshot Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ClusterSnapshot(name: string, args: ClusterSnapshotArgs, opts?: CustomResourceOptions);
@overload
def ClusterSnapshot(resource_name: str,
                    args: ClusterSnapshotArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def ClusterSnapshot(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    db_cluster_identifier: Optional[str] = None,
                    db_cluster_snapshot_identifier: Optional[str] = None)
func NewClusterSnapshot(ctx *Context, name string, args ClusterSnapshotArgs, opts ...ResourceOption) (*ClusterSnapshot, error)
public ClusterSnapshot(string name, ClusterSnapshotArgs args, CustomResourceOptions? opts = null)
public ClusterSnapshot(String name, ClusterSnapshotArgs args)
public ClusterSnapshot(String name, ClusterSnapshotArgs args, CustomResourceOptions options)
type: aws:docdb:ClusterSnapshot
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ClusterSnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ClusterSnapshotArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ClusterSnapshotArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ClusterSnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ClusterSnapshotArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var clusterSnapshotResource = new Aws.DocDB.ClusterSnapshot("clusterSnapshotResource", new()
{
    DbClusterIdentifier = "string",
    DbClusterSnapshotIdentifier = "string",
});
Copy
example, err := docdb.NewClusterSnapshot(ctx, "clusterSnapshotResource", &docdb.ClusterSnapshotArgs{
	DbClusterIdentifier:         pulumi.String("string"),
	DbClusterSnapshotIdentifier: pulumi.String("string"),
})
Copy
var clusterSnapshotResource = new ClusterSnapshot("clusterSnapshotResource", ClusterSnapshotArgs.builder()
    .dbClusterIdentifier("string")
    .dbClusterSnapshotIdentifier("string")
    .build());
Copy
cluster_snapshot_resource = aws.docdb.ClusterSnapshot("clusterSnapshotResource",
    db_cluster_identifier="string",
    db_cluster_snapshot_identifier="string")
Copy
const clusterSnapshotResource = new aws.docdb.ClusterSnapshot("clusterSnapshotResource", {
    dbClusterIdentifier: "string",
    dbClusterSnapshotIdentifier: "string",
});
Copy
type: aws:docdb:ClusterSnapshot
properties:
    dbClusterIdentifier: string
    dbClusterSnapshotIdentifier: string
Copy

ClusterSnapshot Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ClusterSnapshot resource accepts the following input properties:

DbClusterIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The DocumentDB Cluster Identifier from which to take the snapshot.
DbClusterSnapshotIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The Identifier for the snapshot.
DbClusterIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The DocumentDB Cluster Identifier from which to take the snapshot.
DbClusterSnapshotIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The Identifier for the snapshot.
dbClusterIdentifier
This property is required.
Changes to this property will trigger replacement.
String
The DocumentDB Cluster Identifier from which to take the snapshot.
dbClusterSnapshotIdentifier
This property is required.
Changes to this property will trigger replacement.
String
The Identifier for the snapshot.
dbClusterIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The DocumentDB Cluster Identifier from which to take the snapshot.
dbClusterSnapshotIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The Identifier for the snapshot.
db_cluster_identifier
This property is required.
Changes to this property will trigger replacement.
str
The DocumentDB Cluster Identifier from which to take the snapshot.
db_cluster_snapshot_identifier
This property is required.
Changes to this property will trigger replacement.
str
The Identifier for the snapshot.
dbClusterIdentifier
This property is required.
Changes to this property will trigger replacement.
String
The DocumentDB Cluster Identifier from which to take the snapshot.
dbClusterSnapshotIdentifier
This property is required.
Changes to this property will trigger replacement.
String
The Identifier for the snapshot.

Outputs

All input properties are implicitly available as output properties. Additionally, the ClusterSnapshot resource produces the following output properties:

AvailabilityZones List<string>
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
DbClusterSnapshotArn string
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
Engine string
Specifies the name of the database engine.
EngineVersion string
Version of the database engine for this DocumentDB cluster snapshot.
Id string
The provider-assigned unique ID for this managed resource.
KmsKeyId string
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
Port int
Port that the DocumentDB cluster was listening on at the time of the snapshot.
SnapshotType string
SourceDbClusterSnapshotArn string
Status string
The status of this DocumentDB Cluster Snapshot.
StorageEncrypted bool
Specifies whether the DocumentDB cluster snapshot is encrypted.
VpcId string
The VPC ID associated with the DocumentDB cluster snapshot.
AvailabilityZones []string
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
DbClusterSnapshotArn string
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
Engine string
Specifies the name of the database engine.
EngineVersion string
Version of the database engine for this DocumentDB cluster snapshot.
Id string
The provider-assigned unique ID for this managed resource.
KmsKeyId string
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
Port int
Port that the DocumentDB cluster was listening on at the time of the snapshot.
SnapshotType string
SourceDbClusterSnapshotArn string
Status string
The status of this DocumentDB Cluster Snapshot.
StorageEncrypted bool
Specifies whether the DocumentDB cluster snapshot is encrypted.
VpcId string
The VPC ID associated with the DocumentDB cluster snapshot.
availabilityZones List<String>
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
dbClusterSnapshotArn String
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
engine String
Specifies the name of the database engine.
engineVersion String
Version of the database engine for this DocumentDB cluster snapshot.
id String
The provider-assigned unique ID for this managed resource.
kmsKeyId String
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
port Integer
Port that the DocumentDB cluster was listening on at the time of the snapshot.
snapshotType String
sourceDbClusterSnapshotArn String
status String
The status of this DocumentDB Cluster Snapshot.
storageEncrypted Boolean
Specifies whether the DocumentDB cluster snapshot is encrypted.
vpcId String
The VPC ID associated with the DocumentDB cluster snapshot.
availabilityZones string[]
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
dbClusterSnapshotArn string
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
engine string
Specifies the name of the database engine.
engineVersion string
Version of the database engine for this DocumentDB cluster snapshot.
id string
The provider-assigned unique ID for this managed resource.
kmsKeyId string
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
port number
Port that the DocumentDB cluster was listening on at the time of the snapshot.
snapshotType string
sourceDbClusterSnapshotArn string
status string
The status of this DocumentDB Cluster Snapshot.
storageEncrypted boolean
Specifies whether the DocumentDB cluster snapshot is encrypted.
vpcId string
The VPC ID associated with the DocumentDB cluster snapshot.
availability_zones Sequence[str]
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
db_cluster_snapshot_arn str
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
engine str
Specifies the name of the database engine.
engine_version str
Version of the database engine for this DocumentDB cluster snapshot.
id str
The provider-assigned unique ID for this managed resource.
kms_key_id str
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
port int
Port that the DocumentDB cluster was listening on at the time of the snapshot.
snapshot_type str
source_db_cluster_snapshot_arn str
status str
The status of this DocumentDB Cluster Snapshot.
storage_encrypted bool
Specifies whether the DocumentDB cluster snapshot is encrypted.
vpc_id str
The VPC ID associated with the DocumentDB cluster snapshot.
availabilityZones List<String>
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
dbClusterSnapshotArn String
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
engine String
Specifies the name of the database engine.
engineVersion String
Version of the database engine for this DocumentDB cluster snapshot.
id String
The provider-assigned unique ID for this managed resource.
kmsKeyId String
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
port Number
Port that the DocumentDB cluster was listening on at the time of the snapshot.
snapshotType String
sourceDbClusterSnapshotArn String
status String
The status of this DocumentDB Cluster Snapshot.
storageEncrypted Boolean
Specifies whether the DocumentDB cluster snapshot is encrypted.
vpcId String
The VPC ID associated with the DocumentDB cluster snapshot.

Look up Existing ClusterSnapshot Resource

Get an existing ClusterSnapshot resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ClusterSnapshotState, opts?: CustomResourceOptions): ClusterSnapshot
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        availability_zones: Optional[Sequence[str]] = None,
        db_cluster_identifier: Optional[str] = None,
        db_cluster_snapshot_arn: Optional[str] = None,
        db_cluster_snapshot_identifier: Optional[str] = None,
        engine: Optional[str] = None,
        engine_version: Optional[str] = None,
        kms_key_id: Optional[str] = None,
        port: Optional[int] = None,
        snapshot_type: Optional[str] = None,
        source_db_cluster_snapshot_arn: Optional[str] = None,
        status: Optional[str] = None,
        storage_encrypted: Optional[bool] = None,
        vpc_id: Optional[str] = None) -> ClusterSnapshot
func GetClusterSnapshot(ctx *Context, name string, id IDInput, state *ClusterSnapshotState, opts ...ResourceOption) (*ClusterSnapshot, error)
public static ClusterSnapshot Get(string name, Input<string> id, ClusterSnapshotState? state, CustomResourceOptions? opts = null)
public static ClusterSnapshot get(String name, Output<String> id, ClusterSnapshotState state, CustomResourceOptions options)
resources:  _:    type: aws:docdb:ClusterSnapshot    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AvailabilityZones List<string>
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
DbClusterIdentifier Changes to this property will trigger replacement. string
The DocumentDB Cluster Identifier from which to take the snapshot.
DbClusterSnapshotArn string
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
DbClusterSnapshotIdentifier Changes to this property will trigger replacement. string
The Identifier for the snapshot.
Engine string
Specifies the name of the database engine.
EngineVersion string
Version of the database engine for this DocumentDB cluster snapshot.
KmsKeyId string
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
Port int
Port that the DocumentDB cluster was listening on at the time of the snapshot.
SnapshotType string
SourceDbClusterSnapshotArn string
Status string
The status of this DocumentDB Cluster Snapshot.
StorageEncrypted bool
Specifies whether the DocumentDB cluster snapshot is encrypted.
VpcId string
The VPC ID associated with the DocumentDB cluster snapshot.
AvailabilityZones []string
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
DbClusterIdentifier Changes to this property will trigger replacement. string
The DocumentDB Cluster Identifier from which to take the snapshot.
DbClusterSnapshotArn string
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
DbClusterSnapshotIdentifier Changes to this property will trigger replacement. string
The Identifier for the snapshot.
Engine string
Specifies the name of the database engine.
EngineVersion string
Version of the database engine for this DocumentDB cluster snapshot.
KmsKeyId string
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
Port int
Port that the DocumentDB cluster was listening on at the time of the snapshot.
SnapshotType string
SourceDbClusterSnapshotArn string
Status string
The status of this DocumentDB Cluster Snapshot.
StorageEncrypted bool
Specifies whether the DocumentDB cluster snapshot is encrypted.
VpcId string
The VPC ID associated with the DocumentDB cluster snapshot.
availabilityZones List<String>
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
dbClusterIdentifier Changes to this property will trigger replacement. String
The DocumentDB Cluster Identifier from which to take the snapshot.
dbClusterSnapshotArn String
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
dbClusterSnapshotIdentifier Changes to this property will trigger replacement. String
The Identifier for the snapshot.
engine String
Specifies the name of the database engine.
engineVersion String
Version of the database engine for this DocumentDB cluster snapshot.
kmsKeyId String
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
port Integer
Port that the DocumentDB cluster was listening on at the time of the snapshot.
snapshotType String
sourceDbClusterSnapshotArn String
status String
The status of this DocumentDB Cluster Snapshot.
storageEncrypted Boolean
Specifies whether the DocumentDB cluster snapshot is encrypted.
vpcId String
The VPC ID associated with the DocumentDB cluster snapshot.
availabilityZones string[]
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
dbClusterIdentifier Changes to this property will trigger replacement. string
The DocumentDB Cluster Identifier from which to take the snapshot.
dbClusterSnapshotArn string
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
dbClusterSnapshotIdentifier Changes to this property will trigger replacement. string
The Identifier for the snapshot.
engine string
Specifies the name of the database engine.
engineVersion string
Version of the database engine for this DocumentDB cluster snapshot.
kmsKeyId string
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
port number
Port that the DocumentDB cluster was listening on at the time of the snapshot.
snapshotType string
sourceDbClusterSnapshotArn string
status string
The status of this DocumentDB Cluster Snapshot.
storageEncrypted boolean
Specifies whether the DocumentDB cluster snapshot is encrypted.
vpcId string
The VPC ID associated with the DocumentDB cluster snapshot.
availability_zones Sequence[str]
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
db_cluster_identifier Changes to this property will trigger replacement. str
The DocumentDB Cluster Identifier from which to take the snapshot.
db_cluster_snapshot_arn str
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
db_cluster_snapshot_identifier Changes to this property will trigger replacement. str
The Identifier for the snapshot.
engine str
Specifies the name of the database engine.
engine_version str
Version of the database engine for this DocumentDB cluster snapshot.
kms_key_id str
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
port int
Port that the DocumentDB cluster was listening on at the time of the snapshot.
snapshot_type str
source_db_cluster_snapshot_arn str
status str
The status of this DocumentDB Cluster Snapshot.
storage_encrypted bool
Specifies whether the DocumentDB cluster snapshot is encrypted.
vpc_id str
The VPC ID associated with the DocumentDB cluster snapshot.
availabilityZones List<String>
List of EC2 Availability Zones that instances in the DocumentDB cluster snapshot can be restored in.
dbClusterIdentifier Changes to this property will trigger replacement. String
The DocumentDB Cluster Identifier from which to take the snapshot.
dbClusterSnapshotArn String
The Amazon Resource Name (ARN) for the DocumentDB Cluster Snapshot.
dbClusterSnapshotIdentifier Changes to this property will trigger replacement. String
The Identifier for the snapshot.
engine String
Specifies the name of the database engine.
engineVersion String
Version of the database engine for this DocumentDB cluster snapshot.
kmsKeyId String
If storage_encrypted is true, the AWS KMS key identifier for the encrypted DocumentDB cluster snapshot.
port Number
Port that the DocumentDB cluster was listening on at the time of the snapshot.
snapshotType String
sourceDbClusterSnapshotArn String
status String
The status of this DocumentDB Cluster Snapshot.
storageEncrypted Boolean
Specifies whether the DocumentDB cluster snapshot is encrypted.
vpcId String
The VPC ID associated with the DocumentDB cluster snapshot.

Import

Using pulumi import, import aws_docdb_cluster_snapshot using the cluster snapshot identifier. For example:

$ pulumi import aws:docdb/clusterSnapshot:ClusterSnapshot example my-cluster-snapshot
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.