Cluster
Manages a DocumentDB Cluster. Changes to a DocumentDB Cluster can occur when you manually change a parameter, such as port, and are reflected in the next maintenance window. Because of this, this provider may report a difference in its planning phase because a modification has not yet taken place. You can use the apply_immediately flag to instruct the service to apply the change immediately (see documentation below).
Note: using
apply_immediatelycan result in a brief downtime as the server reboots.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const docdb = new aws.docdb.Cluster("docdb", {
clusterIdentifier: "my-docdb-cluster",
engine: "docdb",
masterUsername: "foo",
masterPassword: "mustbeeightchars",
backupRetentionPeriod: 5,
preferredBackupWindow: "07:00-09:00",
skipFinalSnapshot: true,
});import pulumi
import pulumi_aws as aws
docdb = aws.docdb.Cluster("docdb",
cluster_identifier="my-docdb-cluster",
engine="docdb",
master_username="foo",
master_password="mustbeeightchars",
backup_retention_period=5,
preferred_backup_window="07:00-09:00",
skip_final_snapshot=True)using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var docdb = new Aws.DocDB.Cluster("docdb", new()
{
ClusterIdentifier = "my-docdb-cluster",
Engine = "docdb",
MasterUsername = "foo",
MasterPassword = "mustbeeightchars",
BackupRetentionPeriod = 5,
PreferredBackupWindow = "07:00-09:00",
SkipFinalSnapshot = true,
});
});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.NewCluster(ctx, "docdb", &docdb.ClusterArgs{
ClusterIdentifier: pulumi.String("my-docdb-cluster"),
Engine: pulumi.String("docdb"),
MasterUsername: pulumi.String("foo"),
MasterPassword: pulumi.String("mustbeeightchars"),
BackupRetentionPeriod: pulumi.Int(5),
PreferredBackupWindow: pulumi.String("07:00-09:00"),
SkipFinalSnapshot: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.docdb.Cluster;
import com.pulumi.aws.docdb.ClusterArgs;
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 docdb = new Cluster("docdb", ClusterArgs.builder()
.clusterIdentifier("my-docdb-cluster")
.engine("docdb")
.masterUsername("foo")
.masterPassword("mustbeeightchars")
.backupRetentionPeriod(5)
.preferredBackupWindow("07:00-09:00")
.skipFinalSnapshot(true)
.build());
}
}resources:
docdb:
type: aws:docdb:Cluster
properties:
clusterIdentifier: my-docdb-cluster
engine: docdb
masterUsername: foo
masterPassword: mustbeeightchars
backupRetentionPeriod: 5
preferredBackupWindow: 07:00-09:00
skipFinalSnapshot: trueImport
Using pulumi import, import DocumentDB Clusters using the cluster_identifier. For example:
$ pulumi import aws:docdb/cluster:Cluster docdb_cluster docdb-prod-clusterProperties
Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots should not be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced.