ClusterSnapshotCopy class

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/v7/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
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_rds_cluster" "example" {
  cluster_identifier  = "aurora-cluster-demo"
  database_name       = "test"
  engine              = "aurora-mysql"
  master_username     = "tfacctest"
  master_password     = "avoid-plaintext-passwords"
  skip_final_snapshot = true
}
resource "aws_rds_clustersnapshot" "example" {
  db_cluster_identifier          = aws_rds_cluster.example.cluster_identifier
  db_cluster_snapshot_identifier = "example"
}
resource "aws_rds_clustersnapshotcopy" "example" {
  source_db_cluster_snapshot_identifier = aws_rds_clustersnapshot.example.db_cluster_snapshot_arn
  target_db_cluster_snapshot_identifier = "example-copy"
}
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.ArrayList;
import java.util.Arrays;
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.ClusterSnapshotCopy using the id. For example:

$ pulumi import aws:rds/clusterSnapshotCopy:ClusterSnapshotCopy example my-snapshot

Constructors

ClusterSnapshotCopy(String name, {ClusterSnapshotCopyArgs? args, CustomResourceOptions? options})
Creates a new ClusterSnapshotCopy. name The Pulumi resource name. args Arguments used to configure this ClusterSnapshotCopy. The set of arguments for ClusterSnapshotCopy. options Resource options controlling this resource's behavior.
ClusterSnapshotCopy.reference(String urn)
Creates a typed reference to an existing ClusterSnapshotCopy resource.

Properties

allocatedStorage ↔ Output<int>
Specifies the allocated storage size in gigabytes (GB).
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
copyTags ↔ Output<bool?>
Whether to copy existing tags. Defaults to false.
latefinal
dbClusterSnapshotArn ↔ Output<String>
ARN for the DB cluster snapshot.
latefinal
destinationRegion ↔ Output<String?>
The Destination region to place snapshot copy.
latefinal
engine ↔ Output<String>
Specifies the name of the database engine.
latefinal
engineVersion ↔ Output<String>
Specifies the version of the database engine.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
kmsKeyId ↔ Output<String?>
KMS key ID.
latefinal
licenseModel ↔ Output<String>
License model information for the restored DB instance.
latefinal
presignedUrl ↔ Output<String?>
URL that contains a Signature Version 4 signed request.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sharedAccounts ↔ Output<List<String>?>
List of AWS Account IDs to share the snapshot with. Use all to make the snapshot public.
latefinal
snapshotType ↔ Output<String>
latefinal
sourceDbClusterSnapshotIdentifier ↔ Output<String>
Identifier of the source snapshot.
latefinal
storageEncrypted ↔ Output<bool>
Specifies whether the DB cluster snapshot is encrypted.
latefinal
storageType ↔ Output<String>
Specifies the storage type associated with DB cluster snapshot.
latefinal
tags ↔ Output<Map<String, String>?>
Key-value map of resource tags. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
targetDbClusterSnapshotIdentifier ↔ Output<String>
Identifier for the snapshot.
latefinal
timeouts ↔ Output<ClusterSnapshotCopyTimeouts?>
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
vpcId ↔ Output<String>
Provides the VPC ID associated with the DB cluster snapshot.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ClusterSnapshotCopyState? state, CustomResourceOptions? options}) → ClusterSnapshotCopy
Gets an existing ClusterSnapshotCopy resource's state with the given name and id.