@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
238 lines (237 loc) • 11.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Manages an DocumentDB 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 DocumentDB automatically replicates the data to the secondary regions using dedicated infrastructure.
*
* More information about DocumentDB Global Clusters can be found in the [DocumentDB Developer Guide](https://docs.aws.amazon.com/documentdb/latest/developerguide/global-clusters.html).
*
* ## Example Usage
*
* ### New DocumentDB Global Cluster
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.docdb.GlobalCluster("example", {
* globalClusterIdentifier: "global-test",
* engine: "docdb",
* engineVersion: "4.0.0",
* });
* const primary = new aws.docdb.Cluster("primary", {
* engine: example.engine,
* engineVersion: example.engineVersion,
* clusterIdentifier: "test-primary-cluster",
* masterUsername: "username",
* masterPassword: "somepass123",
* globalClusterIdentifier: example.id,
* dbSubnetGroupName: "default",
* });
* const primaryClusterInstance = new aws.docdb.ClusterInstance("primary", {
* engine: example.engine,
* identifier: "test-primary-cluster-instance",
* clusterIdentifier: primary.id,
* instanceClass: "db.r5.large",
* });
* const secondary = new aws.docdb.Cluster("secondary", {
* engine: example.engine,
* engineVersion: example.engineVersion,
* clusterIdentifier: "test-secondary-cluster",
* globalClusterIdentifier: example.id,
* dbSubnetGroupName: "default",
* }, {
* dependsOn: [primary],
* });
* const secondaryClusterInstance = new aws.docdb.ClusterInstance("secondary", {
* engine: example.engine,
* identifier: "test-secondary-cluster-instance",
* clusterIdentifier: secondary.id,
* instanceClass: "db.r5.large",
* }, {
* dependsOn: [primaryClusterInstance],
* });
* ```
*
* ### New Global Cluster From Existing DB Cluster
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.docdb.Cluster("example", {});
* const exampleGlobalCluster = new aws.docdb.GlobalCluster("example", {
* globalClusterIdentifier: "example",
* sourceDbClusterIdentifier: example.arn,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_docdb_global_cluster` using the Global Cluster identifier. For example:
*
* ```sh
* $ pulumi import aws:docdb/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 the Pulumi program on an imported resource, Pulumi will always show a difference. To workaround this behavior, either omit the argument from the Pulumi program or use `ignore_changes` to hide the difference. For example:
*/
export declare class GlobalCluster extends pulumi.CustomResource {
/**
* Get an existing GlobalCluster resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: GlobalClusterState, opts?: pulumi.CustomResourceOptions): GlobalCluster;
/**
* Returns true if the given object is an instance of GlobalCluster. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is GlobalCluster;
/**
* Global Cluster Amazon Resource Name (ARN)
*/
readonly arn: pulumi.Output<string>;
/**
* Name for an automatically created database on cluster creation.
*/
readonly databaseName: pulumi.Output<string | undefined>;
/**
* 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`.
*/
readonly deletionProtection: pulumi.Output<boolean | undefined>;
/**
* Name of the database engine to be used for this DB cluster. The provider will only perform drift detection if a configuration value is provided. Current Valid values: `docdb`. Defaults to `docdb`. Conflicts with `sourceDbClusterIdentifier`.
*/
readonly engine: pulumi.Output<string>;
/**
* Engine version of the global database. Upgrading the engine version will result in all cluster members being immediately updated and will.
* * **NOTE:** Upgrading major versions is not supported.
*/
readonly engineVersion: pulumi.Output<string>;
/**
* The global cluster identifier.
*/
readonly globalClusterIdentifier: pulumi.Output<string>;
/**
* Set of objects containing Global Cluster members.
*/
readonly globalClusterMembers: pulumi.Output<outputs.docdb.GlobalClusterGlobalClusterMember[]>;
/**
* AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed.
*/
readonly globalClusterResourceId: pulumi.Output<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
readonly region: pulumi.Output<string>;
/**
* 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.
*/
readonly sourceDbClusterIdentifier: pulumi.Output<string>;
readonly status: pulumi.Output<string>;
/**
* Specifies whether the DB cluster is encrypted. The default is `false` unless `sourceDbClusterIdentifier` is specified and encrypted. The provider will only perform drift detection if a configuration value is provided.
*/
readonly storageEncrypted: pulumi.Output<boolean>;
/**
* Create a GlobalCluster resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: GlobalClusterArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering GlobalCluster resources.
*/
export interface GlobalClusterState {
/**
* Global Cluster Amazon Resource Name (ARN)
*/
arn?: pulumi.Input<string>;
/**
* Name for an automatically created database on cluster creation.
*/
databaseName?: pulumi.Input<string>;
/**
* 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`.
*/
deletionProtection?: pulumi.Input<boolean>;
/**
* Name of the database engine to be used for this DB cluster. The provider will only perform drift detection if a configuration value is provided. Current Valid values: `docdb`. Defaults to `docdb`. Conflicts with `sourceDbClusterIdentifier`.
*/
engine?: pulumi.Input<string>;
/**
* Engine version of the global database. Upgrading the engine version will result in all cluster members being immediately updated and will.
* * **NOTE:** Upgrading major versions is not supported.
*/
engineVersion?: pulumi.Input<string>;
/**
* The global cluster identifier.
*/
globalClusterIdentifier?: pulumi.Input<string>;
/**
* Set of objects containing Global Cluster members.
*/
globalClusterMembers?: pulumi.Input<pulumi.Input<inputs.docdb.GlobalClusterGlobalClusterMember>[]>;
/**
* AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed.
*/
globalClusterResourceId?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* 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.
*/
sourceDbClusterIdentifier?: pulumi.Input<string>;
status?: pulumi.Input<string>;
/**
* Specifies whether the DB cluster is encrypted. The default is `false` unless `sourceDbClusterIdentifier` is specified and encrypted. The provider will only perform drift detection if a configuration value is provided.
*/
storageEncrypted?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a GlobalCluster resource.
*/
export interface GlobalClusterArgs {
/**
* Name for an automatically created database on cluster creation.
*/
databaseName?: pulumi.Input<string>;
/**
* 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`.
*/
deletionProtection?: pulumi.Input<boolean>;
/**
* Name of the database engine to be used for this DB cluster. The provider will only perform drift detection if a configuration value is provided. Current Valid values: `docdb`. Defaults to `docdb`. Conflicts with `sourceDbClusterIdentifier`.
*/
engine?: pulumi.Input<string>;
/**
* Engine version of the global database. Upgrading the engine version will result in all cluster members being immediately updated and will.
* * **NOTE:** Upgrading major versions is not supported.
*/
engineVersion?: pulumi.Input<string>;
/**
* The global cluster identifier.
*/
globalClusterIdentifier: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* 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.
*/
sourceDbClusterIdentifier?: pulumi.Input<string>;
/**
* Specifies whether the DB cluster is encrypted. The default is `false` unless `sourceDbClusterIdentifier` is specified and encrypted. The provider will only perform drift detection if a configuration value is provided.
*/
storageEncrypted?: pulumi.Input<boolean>;
}