UNPKG

@pulumi/harness

Version:

A Pulumi package for creating and managing Harness resources.

123 lines 4.85 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.DbInstance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for creating a Harness DBDevOps Instance. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * const test = new harness.platform.DbInstance("test", { * identifier: "identifier", * orgId: "org_id", * projectId: "project_id", * name: "name", * tags: [ * "foo:bar", * "bar:foo", * ], * schema: "schema1", * branch: "main", * connector: "jdbcConnector", * context: "ctx", * liquibaseSubstituteProperties: { * key1: "value1", * key2: "value2", * }, * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * Import project level db instance * * ```sh * $ pulumi import harness:platform/dbInstance:DbInstance example <org_id>/<project_id>/<db_schema_id>/<db_instance_id> * ``` */ class DbInstance extends pulumi.CustomResource { /** * Get an existing DbInstance 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 DbInstance(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of DbInstance. 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'] === DbInstance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["branch"] = state?.branch; resourceInputs["connector"] = state?.connector; resourceInputs["context"] = state?.context; resourceInputs["description"] = state?.description; resourceInputs["identifier"] = state?.identifier; resourceInputs["liquibaseSubstituteProperties"] = state?.liquibaseSubstituteProperties; resourceInputs["name"] = state?.name; resourceInputs["orgId"] = state?.orgId; resourceInputs["projectId"] = state?.projectId; resourceInputs["schema"] = state?.schema; resourceInputs["tags"] = state?.tags; } else { const args = argsOrState; if (args?.connector === undefined && !opts.urn) { throw new Error("Missing required property 'connector'"); } if (args?.identifier === undefined && !opts.urn) { throw new Error("Missing required property 'identifier'"); } if (args?.orgId === undefined && !opts.urn) { throw new Error("Missing required property 'orgId'"); } if (args?.projectId === undefined && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if (args?.schema === undefined && !opts.urn) { throw new Error("Missing required property 'schema'"); } resourceInputs["branch"] = args?.branch; resourceInputs["connector"] = args?.connector; resourceInputs["context"] = args?.context; resourceInputs["description"] = args?.description; resourceInputs["identifier"] = args?.identifier; resourceInputs["liquibaseSubstituteProperties"] = args?.liquibaseSubstituteProperties; resourceInputs["name"] = args?.name; resourceInputs["orgId"] = args?.orgId; resourceInputs["projectId"] = args?.projectId; resourceInputs["schema"] = args?.schema; resourceInputs["tags"] = args?.tags; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DbInstance.__pulumiType, name, resourceInputs, opts); } } exports.DbInstance = DbInstance; /** @internal */ DbInstance.__pulumiType = 'harness:platform/dbInstance:DbInstance'; //# sourceMappingURL=dbInstance.js.map