@pulumi/vsphere
Version:
A Pulumi package for creating vsphere resources
72 lines • 4.59 kB
JavaScript
;
// *** 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.Provider = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* The provider type for the vsphere package. By default, resources use package-wide configuration
* settings, however an explicit `Provider` instance may be created and passed during resource
* construction to achieve fine-grained programmatic control over provider settings. See the
* [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
*/
class Provider extends pulumi.ProviderResource {
/**
* Returns true if the given object is an instance of Provider. 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'] === "pulumi:providers:" + Provider.__pulumiType;
}
/**
* Create a Provider 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, args, opts) {
var _a, _b, _c, _d, _e, _f, _g, _h;
let resourceInputs = {};
opts = opts || {};
{
if ((!args || args.password === undefined) && !opts.urn) {
throw new Error("Missing required property 'password'");
}
if ((!args || args.user === undefined) && !opts.urn) {
throw new Error("Missing required property 'user'");
}
resourceInputs["allowUnverifiedSsl"] = pulumi.output((_a = (args ? args.allowUnverifiedSsl : undefined)) !== null && _a !== void 0 ? _a : utilities.getEnvBoolean("VSPHERE_ALLOW_UNVERIFIED_SSL")).apply(JSON.stringify);
resourceInputs["apiTimeout"] = pulumi.output(args ? args.apiTimeout : undefined).apply(JSON.stringify);
resourceInputs["clientDebug"] = pulumi.output((_b = (args ? args.clientDebug : undefined)) !== null && _b !== void 0 ? _b : utilities.getEnvBoolean("VSPHERE_CLIENT_DEBUG")).apply(JSON.stringify);
resourceInputs["clientDebugPath"] = (_c = (args ? args.clientDebugPath : undefined)) !== null && _c !== void 0 ? _c : utilities.getEnv("VSPHERE_CLIENT_DEBUG_PATH");
resourceInputs["clientDebugPathRun"] = (_d = (args ? args.clientDebugPathRun : undefined)) !== null && _d !== void 0 ? _d : utilities.getEnv("VSPHERE_CLIENT_DEBUG_PATH_RUN");
resourceInputs["password"] = args ? args.password : undefined;
resourceInputs["persistSession"] = pulumi.output((_e = (args ? args.persistSession : undefined)) !== null && _e !== void 0 ? _e : utilities.getEnvBoolean("VSPHERE_PERSIST_SESSION")).apply(JSON.stringify);
resourceInputs["restSessionPath"] = (_f = (args ? args.restSessionPath : undefined)) !== null && _f !== void 0 ? _f : utilities.getEnv("VSPHERE_REST_SESSION_PATH");
resourceInputs["user"] = args ? args.user : undefined;
resourceInputs["vcenterServer"] = args ? args.vcenterServer : undefined;
resourceInputs["vimKeepAlive"] = pulumi.output((_g = (args ? args.vimKeepAlive : undefined)) !== null && _g !== void 0 ? _g : utilities.getEnvNumber("VSPHERE_VIM_KEEP_ALIVE")).apply(JSON.stringify);
resourceInputs["vimSessionPath"] = (_h = (args ? args.vimSessionPath : undefined)) !== null && _h !== void 0 ? _h : utilities.getEnv("VSPHERE_VIM_SESSION_PATH");
resourceInputs["vsphereServer"] = args ? args.vsphereServer : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Provider.__pulumiType, name, resourceInputs, opts);
}
/**
* This function returns a Terraform config object with terraform-namecased keys,to be used with the Terraform Module Provider.
*/
terraformConfig() {
return pulumi.runtime.call("pulumi:providers:vsphere/terraformConfig", {
"__self__": this,
}, this);
}
}
exports.Provider = Provider;
/** @internal */
Provider.__pulumiType = 'vsphere';
//# sourceMappingURL=provider.js.map