UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

577 lines (576 loc) • 27.8 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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 * `applyImmediately` flag to instruct the service to apply the change immediately * (see documentation below). * * > **Note:** using `applyImmediately` can result in a brief downtime as the server reboots. * * ## Example Usage * * ```typescript * 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 * * Using `pulumi import`, import DocumentDB Clusters using the `cluster_identifier`. For example: * * ```sh * $ pulumi import aws:docdb/cluster:Cluster docdb_cluster docdb-prod-cluster * ``` */ export declare class Cluster extends pulumi.CustomResource { /** * Get an existing Cluster 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?: ClusterState, opts?: pulumi.CustomResourceOptions): Cluster; /** * Returns true if the given object is an instance of Cluster. 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 Cluster; /** * A value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the DB cluster's current version. */ readonly allowMajorVersionUpgrade: pulumi.Output<boolean | undefined>; /** * Specifies whether any cluster modifications * are applied immediately, or during the next maintenance window. Default is * `false`. */ readonly applyImmediately: pulumi.Output<boolean | undefined>; /** * Amazon Resource Name (ARN) of cluster */ readonly arn: pulumi.Output<string>; /** * A list of EC2 Availability Zones that instances in the DB cluster can be created in. * DocumentDB automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next pulumi up. * We recommend specifying 3 AZs or using the `lifecycle` configuration block `ignoreChanges` argument if necessary. */ readonly availabilityZones: pulumi.Output<string[]>; /** * The days to retain backups for. Default `1` */ readonly backupRetentionPeriod: pulumi.Output<number | undefined>; /** * The cluster identifier. If omitted, the provider will assign a random, unique identifier. */ readonly clusterIdentifier: pulumi.Output<string>; /** * Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`. */ readonly clusterIdentifierPrefix: pulumi.Output<string>; /** * List of DocumentDB Instances that are a part of this cluster */ readonly clusterMembers: pulumi.Output<string[]>; /** * The DocumentDB Cluster Resource ID */ readonly clusterResourceId: pulumi.Output<string>; /** * A cluster parameter group to associate with the cluster. */ readonly dbClusterParameterGroupName: pulumi.Output<string>; /** * A DB subnet group to associate with this DB instance. */ readonly dbSubnetGroupName: pulumi.Output<string>; /** * A boolean value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. Defaults to `false`. */ readonly deletionProtection: pulumi.Output<boolean | undefined>; /** * List of log types to export to cloudwatch. If omitted, no logs will be exported. * The following log types are supported: `audit`, `profiler`. */ readonly enabledCloudwatchLogsExports: pulumi.Output<string[] | undefined>; /** * The DNS address of the DocumentDB instance */ readonly endpoint: pulumi.Output<string>; /** * The name of the database engine to be used for this DB cluster. Defaults to `docdb`. Valid values: `docdb`. */ readonly engine: pulumi.Output<string | undefined>; /** * The database engine version. Updating this argument results in an outage. */ readonly engineVersion: pulumi.Output<string>; /** * The name of your final DB snapshot * when this DB cluster is deleted. If omitted, no final snapshot will be * made. */ readonly finalSnapshotIdentifier: pulumi.Output<string | undefined>; /** * The global cluster identifier specified on `aws.docdb.GlobalCluster`. */ readonly globalClusterIdentifier: pulumi.Output<string | undefined>; /** * The Route53 Hosted Zone ID of the endpoint */ readonly hostedZoneId: pulumi.Output<string>; /** * The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true. */ readonly kmsKeyId: pulumi.Output<string>; /** * Set to `true` to allow Amazon DocumentDB to manage the master user password in AWS Secrets Manager. Cannot be set if `masterPassword` or `masterPasswordWo` is provided. */ readonly manageMasterUserPassword: pulumi.Output<boolean | undefined>; /** * Password for the master DB user. Note that this may * show up in logs, and it will be stored in the state file. Please refer to the DocumentDB Naming Constraints. Conflicts with `masterPasswordWo` and `manageMasterUserPassword`. */ readonly masterPassword: pulumi.Output<string | undefined>; /** * **NOTE:** This field is write-only and its value will not be updated in state as part of read operations. * Password for the master DB user. Note that this may * show up in logs. Please refer to the DocumentDB Naming Constraints. Conflicts with `masterPassword` and `manageMasterUserPassword`. */ readonly masterPasswordWo: pulumi.Output<string | undefined>; /** * Used together with `masterPasswordWo` to trigger an update. Increment this value when an update to the `masterPasswordWo` is required. */ readonly masterPasswordWoVersion: pulumi.Output<number | undefined>; readonly masterUserSecrets: pulumi.Output<outputs.docdb.ClusterMasterUserSecret[]>; /** * Username for the master DB user. */ readonly masterUsername: pulumi.Output<string>; /** * The port on which the DB accepts connections */ readonly port: pulumi.Output<number | undefined>; /** * The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC * Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 */ readonly preferredBackupWindow: pulumi.Output<string>; /** * The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 */ readonly preferredMaintenanceWindow: pulumi.Output<string>; /** * A read-only endpoint for the DocumentDB cluster, automatically load-balanced across replicas */ readonly readerEndpoint: 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>; /** * A configuration block for restoring a DB instance to an arbitrary point in time. Requires the `identifier` argument to be set with the name of the new DB instance to be created. See Restore To Point In Time below for details. */ readonly restoreToPointInTime: pulumi.Output<outputs.docdb.ClusterRestoreToPointInTime | undefined>; /** * Scaling configuration of an Amazon DocumentDB Serverless cluster. See Serverless V2 Scaling Configuration below for details. */ readonly serverlessV2ScalingConfiguration: pulumi.Output<outputs.docdb.ClusterServerlessV2ScalingConfiguration | undefined>; /** * Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`. */ readonly skipFinalSnapshot: pulumi.Output<boolean | undefined>; /** * 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. */ readonly snapshotIdentifier: pulumi.Output<string | undefined>; /** * Specifies whether the DB cluster is encrypted. The default is `false`. */ readonly storageEncrypted: pulumi.Output<boolean | undefined>; /** * The storage type to associate with the DB cluster. Valid values: `standard`, `iopt1`. */ readonly storageType: pulumi.Output<string | undefined>; /** * A map of tags to assign to the DB cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ readonly tagsAll: pulumi.Output<{ [key: string]: string; }>; /** * List of VPC security groups to associate * with the Cluster * * For more detailed documentation about each argument, refer to * the [AWS official documentation](https://docs.aws.amazon.com/cli/latest/reference/docdb/create-db-cluster.html). */ readonly vpcSecurityGroupIds: pulumi.Output<string[]>; /** * Create a Cluster 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?: ClusterArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Cluster resources. */ export interface ClusterState { /** * A value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the DB cluster's current version. */ allowMajorVersionUpgrade?: pulumi.Input<boolean>; /** * Specifies whether any cluster modifications * are applied immediately, or during the next maintenance window. Default is * `false`. */ applyImmediately?: pulumi.Input<boolean>; /** * Amazon Resource Name (ARN) of cluster */ arn?: pulumi.Input<string>; /** * A list of EC2 Availability Zones that instances in the DB cluster can be created in. * DocumentDB automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next pulumi up. * We recommend specifying 3 AZs or using the `lifecycle` configuration block `ignoreChanges` argument if necessary. */ availabilityZones?: pulumi.Input<pulumi.Input<string>[]>; /** * The days to retain backups for. Default `1` */ backupRetentionPeriod?: pulumi.Input<number>; /** * The cluster identifier. If omitted, the provider will assign a random, unique identifier. */ clusterIdentifier?: pulumi.Input<string>; /** * Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`. */ clusterIdentifierPrefix?: pulumi.Input<string>; /** * List of DocumentDB Instances that are a part of this cluster */ clusterMembers?: pulumi.Input<pulumi.Input<string>[]>; /** * The DocumentDB Cluster Resource ID */ clusterResourceId?: pulumi.Input<string>; /** * A cluster parameter group to associate with the cluster. */ dbClusterParameterGroupName?: pulumi.Input<string>; /** * A DB subnet group to associate with this DB instance. */ dbSubnetGroupName?: pulumi.Input<string>; /** * A boolean value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. Defaults to `false`. */ deletionProtection?: pulumi.Input<boolean>; /** * List of log types to export to cloudwatch. If omitted, no logs will be exported. * The following log types are supported: `audit`, `profiler`. */ enabledCloudwatchLogsExports?: pulumi.Input<pulumi.Input<string>[]>; /** * The DNS address of the DocumentDB instance */ endpoint?: pulumi.Input<string>; /** * The name of the database engine to be used for this DB cluster. Defaults to `docdb`. Valid values: `docdb`. */ engine?: pulumi.Input<string>; /** * The database engine version. Updating this argument results in an outage. */ engineVersion?: pulumi.Input<string>; /** * The name of your final DB snapshot * when this DB cluster is deleted. If omitted, no final snapshot will be * made. */ finalSnapshotIdentifier?: pulumi.Input<string>; /** * The global cluster identifier specified on `aws.docdb.GlobalCluster`. */ globalClusterIdentifier?: pulumi.Input<string>; /** * The Route53 Hosted Zone ID of the endpoint */ hostedZoneId?: pulumi.Input<string>; /** * The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true. */ kmsKeyId?: pulumi.Input<string>; /** * Set to `true` to allow Amazon DocumentDB to manage the master user password in AWS Secrets Manager. Cannot be set if `masterPassword` or `masterPasswordWo` is provided. */ manageMasterUserPassword?: pulumi.Input<boolean>; /** * Password for the master DB user. Note that this may * show up in logs, and it will be stored in the state file. Please refer to the DocumentDB Naming Constraints. Conflicts with `masterPasswordWo` and `manageMasterUserPassword`. */ masterPassword?: pulumi.Input<string>; /** * **NOTE:** This field is write-only and its value will not be updated in state as part of read operations. * Password for the master DB user. Note that this may * show up in logs. Please refer to the DocumentDB Naming Constraints. Conflicts with `masterPassword` and `manageMasterUserPassword`. */ masterPasswordWo?: pulumi.Input<string>; /** * Used together with `masterPasswordWo` to trigger an update. Increment this value when an update to the `masterPasswordWo` is required. */ masterPasswordWoVersion?: pulumi.Input<number>; masterUserSecrets?: pulumi.Input<pulumi.Input<inputs.docdb.ClusterMasterUserSecret>[]>; /** * Username for the master DB user. */ masterUsername?: pulumi.Input<string>; /** * The port on which the DB accepts connections */ port?: pulumi.Input<number>; /** * The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC * Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 */ preferredBackupWindow?: pulumi.Input<string>; /** * The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 */ preferredMaintenanceWindow?: pulumi.Input<string>; /** * A read-only endpoint for the DocumentDB cluster, automatically load-balanced across replicas */ readerEndpoint?: 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>; /** * A configuration block for restoring a DB instance to an arbitrary point in time. Requires the `identifier` argument to be set with the name of the new DB instance to be created. See Restore To Point In Time below for details. */ restoreToPointInTime?: pulumi.Input<inputs.docdb.ClusterRestoreToPointInTime>; /** * Scaling configuration of an Amazon DocumentDB Serverless cluster. See Serverless V2 Scaling Configuration below for details. */ serverlessV2ScalingConfiguration?: pulumi.Input<inputs.docdb.ClusterServerlessV2ScalingConfiguration>; /** * Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`. */ skipFinalSnapshot?: pulumi.Input<boolean>; /** * 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. */ snapshotIdentifier?: pulumi.Input<string>; /** * Specifies whether the DB cluster is encrypted. The default is `false`. */ storageEncrypted?: pulumi.Input<boolean>; /** * The storage type to associate with the DB cluster. Valid values: `standard`, `iopt1`. */ storageType?: pulumi.Input<string>; /** * A map of tags to assign to the DB cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ tagsAll?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * List of VPC security groups to associate * with the Cluster * * For more detailed documentation about each argument, refer to * the [AWS official documentation](https://docs.aws.amazon.com/cli/latest/reference/docdb/create-db-cluster.html). */ vpcSecurityGroupIds?: pulumi.Input<pulumi.Input<string>[]>; } /** * The set of arguments for constructing a Cluster resource. */ export interface ClusterArgs { /** * A value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the DB cluster's current version. */ allowMajorVersionUpgrade?: pulumi.Input<boolean>; /** * Specifies whether any cluster modifications * are applied immediately, or during the next maintenance window. Default is * `false`. */ applyImmediately?: pulumi.Input<boolean>; /** * A list of EC2 Availability Zones that instances in the DB cluster can be created in. * DocumentDB automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next pulumi up. * We recommend specifying 3 AZs or using the `lifecycle` configuration block `ignoreChanges` argument if necessary. */ availabilityZones?: pulumi.Input<pulumi.Input<string>[]>; /** * The days to retain backups for. Default `1` */ backupRetentionPeriod?: pulumi.Input<number>; /** * The cluster identifier. If omitted, the provider will assign a random, unique identifier. */ clusterIdentifier?: pulumi.Input<string>; /** * Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`. */ clusterIdentifierPrefix?: pulumi.Input<string>; /** * List of DocumentDB Instances that are a part of this cluster */ clusterMembers?: pulumi.Input<pulumi.Input<string>[]>; /** * A cluster parameter group to associate with the cluster. */ dbClusterParameterGroupName?: pulumi.Input<string>; /** * A DB subnet group to associate with this DB instance. */ dbSubnetGroupName?: pulumi.Input<string>; /** * A boolean value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. Defaults to `false`. */ deletionProtection?: pulumi.Input<boolean>; /** * List of log types to export to cloudwatch. If omitted, no logs will be exported. * The following log types are supported: `audit`, `profiler`. */ enabledCloudwatchLogsExports?: pulumi.Input<pulumi.Input<string>[]>; /** * The name of the database engine to be used for this DB cluster. Defaults to `docdb`. Valid values: `docdb`. */ engine?: pulumi.Input<string>; /** * The database engine version. Updating this argument results in an outage. */ engineVersion?: pulumi.Input<string>; /** * The name of your final DB snapshot * when this DB cluster is deleted. If omitted, no final snapshot will be * made. */ finalSnapshotIdentifier?: pulumi.Input<string>; /** * The global cluster identifier specified on `aws.docdb.GlobalCluster`. */ globalClusterIdentifier?: pulumi.Input<string>; /** * The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true. */ kmsKeyId?: pulumi.Input<string>; /** * Set to `true` to allow Amazon DocumentDB to manage the master user password in AWS Secrets Manager. Cannot be set if `masterPassword` or `masterPasswordWo` is provided. */ manageMasterUserPassword?: pulumi.Input<boolean>; /** * Password for the master DB user. Note that this may * show up in logs, and it will be stored in the state file. Please refer to the DocumentDB Naming Constraints. Conflicts with `masterPasswordWo` and `manageMasterUserPassword`. */ masterPassword?: pulumi.Input<string>; /** * **NOTE:** This field is write-only and its value will not be updated in state as part of read operations. * Password for the master DB user. Note that this may * show up in logs. Please refer to the DocumentDB Naming Constraints. Conflicts with `masterPassword` and `manageMasterUserPassword`. */ masterPasswordWo?: pulumi.Input<string>; /** * Used together with `masterPasswordWo` to trigger an update. Increment this value when an update to the `masterPasswordWo` is required. */ masterPasswordWoVersion?: pulumi.Input<number>; /** * Username for the master DB user. */ masterUsername?: pulumi.Input<string>; /** * The port on which the DB accepts connections */ port?: pulumi.Input<number>; /** * The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC * Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 */ preferredBackupWindow?: pulumi.Input<string>; /** * The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 */ preferredMaintenanceWindow?: 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>; /** * A configuration block for restoring a DB instance to an arbitrary point in time. Requires the `identifier` argument to be set with the name of the new DB instance to be created. See Restore To Point In Time below for details. */ restoreToPointInTime?: pulumi.Input<inputs.docdb.ClusterRestoreToPointInTime>; /** * Scaling configuration of an Amazon DocumentDB Serverless cluster. See Serverless V2 Scaling Configuration below for details. */ serverlessV2ScalingConfiguration?: pulumi.Input<inputs.docdb.ClusterServerlessV2ScalingConfiguration>; /** * Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`. */ skipFinalSnapshot?: pulumi.Input<boolean>; /** * 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. */ snapshotIdentifier?: pulumi.Input<string>; /** * Specifies whether the DB cluster is encrypted. The default is `false`. */ storageEncrypted?: pulumi.Input<boolean>; /** * The storage type to associate with the DB cluster. Valid values: `standard`, `iopt1`. */ storageType?: pulumi.Input<string>; /** * A map of tags to assign to the DB cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * List of VPC security groups to associate * with the Cluster * * For more detailed documentation about each argument, refer to * the [AWS official documentation](https://docs.aws.amazon.com/cli/latest/reference/docdb/create-db-cluster.html). */ vpcSecurityGroupIds?: pulumi.Input<pulumi.Input<string>[]>; }