UNPKG

@pulumi/harness

Version:

A Pulumi package for creating and managing Harness resources.

137 lines 6.67 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.AzureProxy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for creating an Azure autostopping proxy * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * const test = new harness.autostopping.AzureProxy("test", { * name: "name", * cloudConnectorId: "cloud_connector_id", * hostName: "host_name", * region: "eastus2", * resourceGroup: "resource_group", * vpc: "/subscriptions/subscription_id/resourceGroups/resource_group/providers/Microsoft.Network/virtualNetworks/virtual_network", * subnetId: "/subscriptions/subscription_id/resourceGroups/resource_group/providers/Microsoft.Network/virtualNetworks/virtual_network/subnets/subnet_id", * securityGroups: ["/subscriptions/subscription_id/resourceGroups/resource_group/providers/Microsoft.Network/networkSecurityGroups/network_security_group"], * allocateStaticIp: true, * machineType: "Standard_D2s_v3", * keypair: "", * apiKey: "", * deleteCloudResourcesOnDestroy: true, * }); * ``` */ class AzureProxy extends pulumi.CustomResource { /** * Get an existing AzureProxy 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 AzureProxy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AzureProxy. 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'] === AzureProxy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allocateStaticIp"] = state?.allocateStaticIp; resourceInputs["apiKey"] = state?.apiKey; resourceInputs["certificateId"] = state?.certificateId; resourceInputs["certificates"] = state?.certificates; resourceInputs["cloudConnectorId"] = state?.cloudConnectorId; resourceInputs["deleteCloudResourcesOnDestroy"] = state?.deleteCloudResourcesOnDestroy; resourceInputs["hostName"] = state?.hostName; resourceInputs["identifier"] = state?.identifier; resourceInputs["keypair"] = state?.keypair; resourceInputs["machineType"] = state?.machineType; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["resourceGroup"] = state?.resourceGroup; resourceInputs["securityGroups"] = state?.securityGroups; resourceInputs["subnetId"] = state?.subnetId; resourceInputs["vpc"] = state?.vpc; } else { const args = argsOrState; if (args?.apiKey === undefined && !opts.urn) { throw new Error("Missing required property 'apiKey'"); } if (args?.cloudConnectorId === undefined && !opts.urn) { throw new Error("Missing required property 'cloudConnectorId'"); } if (args?.deleteCloudResourcesOnDestroy === undefined && !opts.urn) { throw new Error("Missing required property 'deleteCloudResourcesOnDestroy'"); } if (args?.hostName === undefined && !opts.urn) { throw new Error("Missing required property 'hostName'"); } if (args?.keypair === undefined && !opts.urn) { throw new Error("Missing required property 'keypair'"); } if (args?.machineType === undefined && !opts.urn) { throw new Error("Missing required property 'machineType'"); } if (args?.region === undefined && !opts.urn) { throw new Error("Missing required property 'region'"); } if (args?.resourceGroup === undefined && !opts.urn) { throw new Error("Missing required property 'resourceGroup'"); } if (args?.subnetId === undefined && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } if (args?.vpc === undefined && !opts.urn) { throw new Error("Missing required property 'vpc'"); } resourceInputs["allocateStaticIp"] = args?.allocateStaticIp; resourceInputs["apiKey"] = args?.apiKey ? pulumi.secret(args.apiKey) : undefined; resourceInputs["certificateId"] = args?.certificateId; resourceInputs["certificates"] = args?.certificates; resourceInputs["cloudConnectorId"] = args?.cloudConnectorId; resourceInputs["deleteCloudResourcesOnDestroy"] = args?.deleteCloudResourcesOnDestroy; resourceInputs["hostName"] = args?.hostName; resourceInputs["keypair"] = args?.keypair; resourceInputs["machineType"] = args?.machineType; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["resourceGroup"] = args?.resourceGroup; resourceInputs["securityGroups"] = args?.securityGroups; resourceInputs["subnetId"] = args?.subnetId; resourceInputs["vpc"] = args?.vpc; resourceInputs["identifier"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["apiKey"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(AzureProxy.__pulumiType, name, resourceInputs, opts); } } exports.AzureProxy = AzureProxy; /** @internal */ AzureProxy.__pulumiType = 'harness:autostopping/azureProxy:AzureProxy'; //# sourceMappingURL=azureProxy.js.map