UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

164 lines 8.36 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.DatabasePostgresqlV2 = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Linode PostgreSQL Database resource. This can be used to create, modify, and delete Linode PostgreSQL Databases. * For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instances). * * Please keep in mind that Managed Databases can take up to half an hour to provision. * * ## Example Usage * * Creating a simple PostgreSQL database that does not allow connections: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const foobar = new linode.DatabasePostgresqlV2("foobar", { * label: "mydatabase", * engineId: "postgresql/16", * region: "us-mia", * type: "g6-nanode-1", * }); * ``` * * Creating a simple PostgreSQL database that allows connections from all IPv4 addresses: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const foobar = new linode.DatabasePostgresqlV2("foobar", { * label: "mydatabase", * engineId: "postgresql/16", * region: "us-mia", * type: "g6-nanode-1", * allowLists: ["0.0.0.0/0"], * }); * ``` * * Creating a complex PostgreSQL database: * * ## Import * * Linode PostgreSQL Databases can be imported using the `id`, e.g. * * ```sh * $ pulumi import linode:index/databasePostgresqlV2:DatabasePostgresqlV2 foobar 1234567 * ``` */ class DatabasePostgresqlV2 extends pulumi.CustomResource { /** * Get an existing DatabasePostgresqlV2 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 DatabasePostgresqlV2(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of DatabasePostgresqlV2. 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'] === DatabasePostgresqlV2.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowLists"] = state ? state.allowLists : undefined; resourceInputs["caCert"] = state ? state.caCert : undefined; resourceInputs["clusterSize"] = state ? state.clusterSize : undefined; resourceInputs["created"] = state ? state.created : undefined; resourceInputs["encrypted"] = state ? state.encrypted : undefined; resourceInputs["engine"] = state ? state.engine : undefined; resourceInputs["engineId"] = state ? state.engineId : undefined; resourceInputs["forkRestoreTime"] = state ? state.forkRestoreTime : undefined; resourceInputs["forkSource"] = state ? state.forkSource : undefined; resourceInputs["hostPrimary"] = state ? state.hostPrimary : undefined; resourceInputs["hostSecondary"] = state ? state.hostSecondary : undefined; resourceInputs["label"] = state ? state.label : undefined; resourceInputs["members"] = state ? state.members : undefined; resourceInputs["oldestRestoreTime"] = state ? state.oldestRestoreTime : undefined; resourceInputs["pendingUpdates"] = state ? state.pendingUpdates : undefined; resourceInputs["platform"] = state ? state.platform : undefined; resourceInputs["port"] = state ? state.port : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["rootPassword"] = state ? state.rootPassword : undefined; resourceInputs["rootUsername"] = state ? state.rootUsername : undefined; resourceInputs["sslConnection"] = state ? state.sslConnection : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["suspended"] = state ? state.suspended : undefined; resourceInputs["timeouts"] = state ? state.timeouts : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["updated"] = state ? state.updated : undefined; resourceInputs["updates"] = state ? state.updates : undefined; resourceInputs["version"] = state ? state.version : undefined; } else { const args = argsOrState; if ((!args || args.engineId === undefined) && !opts.urn) { throw new Error("Missing required property 'engineId'"); } if ((!args || args.label === undefined) && !opts.urn) { throw new Error("Missing required property 'label'"); } if ((!args || args.region === undefined) && !opts.urn) { throw new Error("Missing required property 'region'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["allowLists"] = args ? args.allowLists : undefined; resourceInputs["clusterSize"] = args ? args.clusterSize : undefined; resourceInputs["engineId"] = args ? args.engineId : undefined; resourceInputs["forkRestoreTime"] = args ? args.forkRestoreTime : undefined; resourceInputs["forkSource"] = args ? args.forkSource : undefined; resourceInputs["label"] = args ? args.label : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["suspended"] = args ? args.suspended : undefined; resourceInputs["timeouts"] = args ? args.timeouts : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["updates"] = args ? args.updates : undefined; resourceInputs["caCert"] = undefined /*out*/; resourceInputs["created"] = undefined /*out*/; resourceInputs["encrypted"] = undefined /*out*/; resourceInputs["engine"] = undefined /*out*/; resourceInputs["hostPrimary"] = undefined /*out*/; resourceInputs["hostSecondary"] = undefined /*out*/; resourceInputs["members"] = undefined /*out*/; resourceInputs["oldestRestoreTime"] = undefined /*out*/; resourceInputs["pendingUpdates"] = undefined /*out*/; resourceInputs["platform"] = undefined /*out*/; resourceInputs["port"] = undefined /*out*/; resourceInputs["rootPassword"] = undefined /*out*/; resourceInputs["rootUsername"] = undefined /*out*/; resourceInputs["sslConnection"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updated"] = undefined /*out*/; resourceInputs["version"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["caCert", "rootPassword", "rootUsername"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(DatabasePostgresqlV2.__pulumiType, name, resourceInputs, opts); } } exports.DatabasePostgresqlV2 = DatabasePostgresqlV2; /** @internal */ DatabasePostgresqlV2.__pulumiType = 'linode:index/databasePostgresqlV2:DatabasePostgresqlV2'; //# sourceMappingURL=databasePostgresqlV2.js.map