UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

249 lines 12.2 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.MdbSqlServerCluster = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a SQLServer cluster within the Yandex.Cloud. For more information, see * [the official documentation](https://cloud.yandex.com/docs/managed-sqlserver/). * * Please read [Pricing for Managed Service for SQL Server](https://cloud.yandex.com/docs/managed-sqlserver/pricing#prices) before using SQLServer cluster. * * ## Example Usage * * Example of creating a Single Node SQLServer. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const fooVpcNetwork = new yandex.VpcNetwork("fooVpcNetwork", {}); * const fooVpcSubnet = new yandex.VpcSubnet("fooVpcSubnet", { * zone: "ru-central1-a", * networkId: fooVpcNetwork.id, * v4CidrBlocks: ["10.5.0.0/24"], * }); * const test_sg_x = new yandex.VpcSecurityGroup("test-sg-x", { * networkId: fooVpcNetwork.id, * ingresses: [{ * protocol: "ANY", * description: "Allow incoming traffic from members of the same security group", * fromPort: 0, * toPort: 65535, * v4CidrBlocks: ["0.0.0.0/0"], * }], * egresses: [{ * protocol: "ANY", * description: "Allow outgoing traffic to members of the same security group", * fromPort: 0, * toPort: 65535, * v4CidrBlocks: ["0.0.0.0/0"], * }], * }); * const fooMdbSqlServerCluster = new yandex.MdbSqlServerCluster("fooMdbSqlServerCluster", { * environment: "PRESTABLE", * networkId: fooVpcNetwork.id, * version: "2016sp2std", * resources: { * resourcePresetId: "s2.small", * diskTypeId: "network-ssd", * diskSize: 20, * }, * labels: { * test_key: "test_value", * }, * backupWindowStart: { * hours: 20, * minutes: 30, * }, * sqlserverConfig: { * fill_factor_percent: 49, * optimize_for_ad_hoc_workloads: true, * }, * databases: [ * { * name: "db_name_a", * }, * { * name: "db_name", * }, * { * name: "db_name_b", * }, * ], * users: [ * { * name: "bob", * password: "mysecurepassword", * }, * { * name: "alice", * password: "mysecurepassword", * permissions: [{ * databaseName: "db_name", * roles: ["DDLADMIN"], * }], * }, * { * name: "chuck", * password: "mysecurepassword", * permissions: [ * { * databaseName: "db_name_a", * roles: ["OWNER"], * }, * { * databaseName: "db_name", * roles: [ * "OWNER", * "DDLADMIN", * ], * }, * { * databaseName: "db_name_b", * roles: [ * "OWNER", * "DDLADMIN", * ], * }, * ], * }, * ], * hosts: [{ * zone: "ru-central1-a", * subnetId: fooVpcSubnet.id, * }], * securityGroupIds: [test_sg_x.id], * hostGroupIds: [ * "host_group_1", * "host_group_2", * ], * }); * ``` * ## SQLServer config * * If not specified `sqlserverConfig` then does not make any changes. * * * maxDegreeOfParallelism - Limits the number of processors to use in parallel plan execution per task. See in-depth description in [SQL Server documentation](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option?view=sql-server-2016). * * * costThresholdForParallelism - Specifies the threshold at which SQL Server creates and runs parallel plans for queries. SQL Server creates and runs a parallel plan for a query only when the estimated cost to run a serial plan for the same query is higher than the value of the option. See in-depth description in [SQL Server documentation](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-cost-threshold-for-parallelism-server-configuration-option?view=sql-server-2016). * * * auditLevel - Describes how to configure login auditing to monitor SQL Server Database Engine login activity. Possible values: * - 0 — do not log login attempts,˚√ * - 1 — log only failed login attempts, * - 2 — log only successful login attempts (not recommended), * - 3 — log all login attempts (not recommended). * See in-depth description in [SQL Server documentation](https://docs.microsoft.com/en-us/sql/ssms/configure-login-auditing-sql-server-management-studio?view=sql-server-2016). * * * fillFactorPercent - Manages the fill factor server configuration option. When an index is created or rebuilt the fill factor determines the percentage of space on each index leaf-level page to be filled with data, reserving the rest as free space for future growth. Values 0 and 100 mean full page usage (no space reserved). See in-depth description in [SQL Server documentation](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-fill-factor-server-configuration-option?view=sql-server-2016). * * optimizeForAdHocWorkloads - Determines whether plans should be cached only after second execution. Allows to avoid SQL cache bloat because of single-use plans. See in-depth description in [SQL Server documentation](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/optimize-for-ad-hoc-workloads-server-configuration-option?view=sql-server-2016). * * ## Import * * A cluster can be imported using the `id` of the resource, e.g. * * ```sh * $ pulumi import yandex:index/mdbSqlServerCluster:MdbSqlServerCluster foo cluster_id * ``` */ class MdbSqlServerCluster extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["backupWindowStart"] = state ? state.backupWindowStart : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["databases"] = state ? state.databases : undefined; resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["environment"] = state ? state.environment : undefined; resourceInputs["folderId"] = state ? state.folderId : undefined; resourceInputs["health"] = state ? state.health : undefined; resourceInputs["hostGroupIds"] = state ? state.hostGroupIds : undefined; resourceInputs["hosts"] = state ? state.hosts : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["networkId"] = state ? state.networkId : undefined; resourceInputs["resources"] = state ? state.resources : undefined; resourceInputs["securityGroupIds"] = state ? state.securityGroupIds : undefined; resourceInputs["sqlserverConfig"] = state ? state.sqlserverConfig : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["users"] = state ? state.users : undefined; resourceInputs["version"] = state ? state.version : undefined; } else { const args = argsOrState; if ((!args || args.databases === undefined) && !opts.urn) { throw new Error("Missing required property 'databases'"); } if ((!args || args.environment === undefined) && !opts.urn) { throw new Error("Missing required property 'environment'"); } if ((!args || args.hosts === undefined) && !opts.urn) { throw new Error("Missing required property 'hosts'"); } if ((!args || args.networkId === undefined) && !opts.urn) { throw new Error("Missing required property 'networkId'"); } if ((!args || args.resources === undefined) && !opts.urn) { throw new Error("Missing required property 'resources'"); } if ((!args || args.users === undefined) && !opts.urn) { throw new Error("Missing required property 'users'"); } if ((!args || args.version === undefined) && !opts.urn) { throw new Error("Missing required property 'version'"); } resourceInputs["backupWindowStart"] = args ? args.backupWindowStart : undefined; resourceInputs["databases"] = args ? args.databases : undefined; resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["environment"] = args ? args.environment : undefined; resourceInputs["folderId"] = args ? args.folderId : undefined; resourceInputs["hostGroupIds"] = args ? args.hostGroupIds : undefined; resourceInputs["hosts"] = args ? args.hosts : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["networkId"] = args ? args.networkId : undefined; resourceInputs["resources"] = args ? args.resources : undefined; resourceInputs["securityGroupIds"] = args ? args.securityGroupIds : undefined; resourceInputs["sqlserverConfig"] = args ? args.sqlserverConfig : undefined; resourceInputs["users"] = args ? args.users : undefined; resourceInputs["version"] = args ? args.version : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["health"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MdbSqlServerCluster.__pulumiType, name, resourceInputs, opts); } /** * Get an existing MdbSqlServerCluster 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, id, state, opts) { return new MdbSqlServerCluster(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MdbSqlServerCluster. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === MdbSqlServerCluster.__pulumiType; } } exports.MdbSqlServerCluster = MdbSqlServerCluster; /** @internal */ MdbSqlServerCluster.__pulumiType = 'yandex:index/mdbSqlServerCluster:MdbSqlServerCluster'; //# sourceMappingURL=mdbSqlServerCluster.js.map