Cluster Snapshot Copy
Manages an RDS database cluster snapshot copy. For managing RDS database instance snapshot copies, see the aws.rds.SnapshotCopy
resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.rds.Cluster("example", {
clusterIdentifier: "aurora-cluster-demo",
databaseName: "test",
engine: aws.rds.EngineType.AuroraMysql,
masterUsername: "tfacctest",
masterPassword: "avoid-plaintext-passwords",
skipFinalSnapshot: true,
});
const exampleClusterSnapshot = new aws.rds.ClusterSnapshot("example", {
dbClusterIdentifier: example.clusterIdentifier,
dbClusterSnapshotIdentifier: "example",
});
const exampleClusterSnapshotCopy = new aws.rds.ClusterSnapshotCopy("example", {
sourceDbClusterSnapshotIdentifier: exampleClusterSnapshot.dbClusterSnapshotArn,
targetDbClusterSnapshotIdentifier: "example-copy",
});
import pulumi
import pulumi_aws as aws
example = aws.rds.Cluster("example",
cluster_identifier="aurora-cluster-demo",
database_name="test",
engine=aws.rds.EngineType.AURORA_MYSQL,
master_username="tfacctest",
master_password="avoid-plaintext-passwords",
skip_final_snapshot=True)
example_cluster_snapshot = aws.rds.ClusterSnapshot("example",
db_cluster_identifier=example.cluster_identifier,
db_cluster_snapshot_identifier="example")
example_cluster_snapshot_copy = aws.rds.ClusterSnapshotCopy("example",
source_db_cluster_snapshot_identifier=example_cluster_snapshot.db_cluster_snapshot_arn,
target_db_cluster_snapshot_identifier="example-copy")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Rds.Cluster("example", new()
{
ClusterIdentifier = "aurora-cluster-demo",
DatabaseName = "test",
Engine = Aws.Rds.EngineType.AuroraMysql,
MasterUsername = "tfacctest",
MasterPassword = "avoid-plaintext-passwords",
SkipFinalSnapshot = true,
});
var exampleClusterSnapshot = new Aws.Rds.ClusterSnapshot("example", new()
{
DbClusterIdentifier = example.ClusterIdentifier,
DbClusterSnapshotIdentifier = "example",
});
var exampleClusterSnapshotCopy = new Aws.Rds.ClusterSnapshotCopy("example", new()
{
SourceDbClusterSnapshotIdentifier = exampleClusterSnapshot.DbClusterSnapshotArn,
TargetDbClusterSnapshotIdentifier = "example-copy",
});
});
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 {
example, err := rds.NewCluster(ctx, "example", &rds.ClusterArgs{
ClusterIdentifier: pulumi.String("aurora-cluster-demo"),
DatabaseName: pulumi.String("test"),
Engine: pulumi.String(rds.EngineTypeAuroraMysql),
MasterUsername: pulumi.String("tfacctest"),
MasterPassword: pulumi.String("avoid-plaintext-passwords"),
SkipFinalSnapshot: pulumi.Bool(true),
})
if err != nil {
return err
}
exampleClusterSnapshot, err := rds.NewClusterSnapshot(ctx, "example", &rds.ClusterSnapshotArgs{
DbClusterIdentifier: example.ClusterIdentifier,
DbClusterSnapshotIdentifier: pulumi.String("example"),
})
if err != nil {
return err
}
_, err = rds.NewClusterSnapshotCopy(ctx, "example", &rds.ClusterSnapshotCopyArgs{
SourceDbClusterSnapshotIdentifier: exampleClusterSnapshot.DbClusterSnapshotArn,
TargetDbClusterSnapshotIdentifier: pulumi.String("example-copy"),
})
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.rds.Cluster;
import com.pulumi.aws.rds.ClusterArgs;
import com.pulumi.aws.rds.ClusterSnapshot;
import com.pulumi.aws.rds.ClusterSnapshotArgs;
import com.pulumi.aws.rds.ClusterSnapshotCopy;
import com.pulumi.aws.rds.ClusterSnapshotCopyArgs;
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 Cluster("example", ClusterArgs.builder()
.clusterIdentifier("aurora-cluster-demo")
.databaseName("test")
.engine("aurora-mysql")
.masterUsername("tfacctest")
.masterPassword("avoid-plaintext-passwords")
.skipFinalSnapshot(true)
.build());
var exampleClusterSnapshot = new ClusterSnapshot("exampleClusterSnapshot", ClusterSnapshotArgs.builder()
.dbClusterIdentifier(example.clusterIdentifier())
.dbClusterSnapshotIdentifier("example")
.build());
var exampleClusterSnapshotCopy = new ClusterSnapshotCopy("exampleClusterSnapshotCopy", ClusterSnapshotCopyArgs.builder()
.sourceDbClusterSnapshotIdentifier(exampleClusterSnapshot.dbClusterSnapshotArn())
.targetDbClusterSnapshotIdentifier("example-copy")
.build());
}
}
resources:
example:
type: aws:rds:Cluster
properties:
clusterIdentifier: aurora-cluster-demo
databaseName: test
engine: aurora-mysql
masterUsername: tfacctest
masterPassword: avoid-plaintext-passwords
skipFinalSnapshot: true
exampleClusterSnapshot:
type: aws:rds:ClusterSnapshot
name: example
properties:
dbClusterIdentifier: ${example.clusterIdentifier}
dbClusterSnapshotIdentifier: example
exampleClusterSnapshotCopy:
type: aws:rds:ClusterSnapshotCopy
name: example
properties:
sourceDbClusterSnapshotIdentifier: ${exampleClusterSnapshot.dbClusterSnapshotArn}
targetDbClusterSnapshotIdentifier: example-copy
Import
Using pulumi import
, import aws_rds_cluster_snapshot_copy
using the id
. For example:
$ pulumi import aws:rds/clusterSnapshotCopy:ClusterSnapshotCopy example my-snapshot
Properties
Specifies the allocated storage size in gigabytes (GB).
The Amazon Resource Name (ARN) for the DB cluster snapshot.
The Destination region to place snapshot copy.
Specifies the version of the database engine.
License model information for the restored DB instance.
URL that contains a Signature Version 4 signed request.
List of AWS Account IDs to share the snapshot with. Use all
to make the snapshot public.
Identifier of the source snapshot.
Specifies whether the DB cluster snapshot is encrypted.
Specifies the storage type associated with DB cluster snapshot.
Identifier for the snapshot. The following arguments are optional: