Global Cluster Args
Manages a Neptune Global Cluster. A global cluster consists of one primary region and up to five read-only secondary regions. You issue write operations directly to the primary cluster in the primary region and Amazon Neptune automatically replicates the data to the secondary regions using dedicated infrastructure. More information about Neptune Global Clusters can be found in the Neptune User Guide.
Example Usage
New Neptune Global Cluster
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.Provider;
import com.pulumi.aws.ProviderArgs;
import com.pulumi.aws.neptune.GlobalCluster;
import com.pulumi.aws.neptune.GlobalClusterArgs;
import com.pulumi.aws.neptune.Cluster;
import com.pulumi.aws.neptune.ClusterArgs;
import com.pulumi.aws.neptune.ClusterInstance;
import com.pulumi.aws.neptune.ClusterInstanceArgs;
import com.pulumi.resources.CustomResourceOptions;
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 primary = new Provider("primary", ProviderArgs.builder()
.region("us-east-2")
.build());
var secondary = new Provider("secondary", ProviderArgs.builder()
.region("us-east-1")
.build());
var example = new GlobalCluster("example", GlobalClusterArgs.builder()
.globalClusterIdentifier("global-test")
.engine("neptune")
.engineVersion("1.2.0.0")
.build());
var primaryCluster = new Cluster("primaryCluster", ClusterArgs.builder()
.engine(example.engine())
.engineVersion(example.engineVersion())
.clusterIdentifier("test-primary-cluster")
.globalClusterIdentifier(example.id())
.neptuneSubnetGroupName("default")
.build(), CustomResourceOptions.builder()
.provider(aws.primary())
.build());
var primaryClusterInstance = new ClusterInstance("primaryClusterInstance", ClusterInstanceArgs.builder()
.engine(example.engine())
.engineVersion(example.engineVersion())
.identifier("test-primary-cluster-instance")
.clusterIdentifier(primaryCluster.id())
.instanceClass("db.r5.large")
.neptuneSubnetGroupName("default")
.build(), CustomResourceOptions.builder()
.provider(aws.primary())
.build());
var secondaryCluster = new Cluster("secondaryCluster", ClusterArgs.builder()
.engine(example.engine())
.engineVersion(example.engineVersion())
.clusterIdentifier("test-secondary-cluster")
.globalClusterIdentifier(example.id())
.neptuneSubnetGroupName("default")
.build(), CustomResourceOptions.builder()
.provider(aws.secondary())
.build());
var secondaryClusterInstance = new ClusterInstance("secondaryClusterInstance", ClusterInstanceArgs.builder()
.engine(example.engine())
.engineVersion(example.engineVersion())
.identifier("test-secondary-cluster-instance")
.clusterIdentifier(secondaryCluster.id())
.instanceClass("db.r5.large")
.neptuneSubnetGroupName("default")
.build(), CustomResourceOptions.builder()
.provider(aws.secondary())
.dependsOn(primaryClusterInstance)
.build());
}
}
New Global Cluster From Existing DB Cluster
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.neptune.Cluster;
import com.pulumi.aws.neptune.GlobalCluster;
import com.pulumi.aws.neptune.GlobalClusterArgs;
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 exampleCluster = new Cluster("exampleCluster");
var exampleGlobalCluster = new GlobalCluster("exampleGlobalCluster", GlobalClusterArgs.builder()
.globalClusterIdentifier("example")
.sourceDbClusterIdentifier(exampleCluster.arn())
.build());
}
}
Import
aws_neptune_global_cluster
can be imported by using the Global Cluster identifier, e.g.
$ pulumi import aws:neptune/globalCluster:GlobalCluster example example
Certain resource arguments, like source_db_cluster_identifier
, do not have an API method for reading the information after creation. If the argument is set in configuration on an imported resource, the provider will always show a difference. To workaround this behavior, either omit the argument from configuration or use ignore_changes
to hide the difference, e.g. terraform resource "aws_neptune_global_cluster" "example" {
... other configuration ...
There is no API for reading source_db_cluster_identifier
lifecycle { ignore_changes = source_db_cluster_identifier } }
Properties
If the Global Cluster should have deletion protection enabled. The database can't be deleted when this value is set to true
. The default is false
.
Engine version of the global database. Upgrading the engine version will result in all cluster members being immediately updated and will.
The global cluster identifier.
Amazon Resource Name (ARN) to use as the primary DB Cluster of the Global Cluster on creation. The provider cannot perform drift detection of this value.
Specifies whether the DB cluster is encrypted. The default is false
unless source_db_cluster_identifier
is specified and encrypted. The provider will only perform drift detection if a configuration value is provided.