UNPKG

@pulumi/harness

Version:

A Pulumi package for creating and managing Harness resources.

133 lines 6.13 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.GcpProxy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for creating an GCP Autostopping proxy * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * const test = new harness.autostopping.GcpProxy("test", { * name: "name", * cloudConnectorId: "cloud_connector_id", * hostName: "host_name", * region: "region", * vpc: "https://www.googleapis.com/compute/v1/projects/project_id/global/networks/netwok_id", * zone: "zone", * securityGroups: ["http-server"], * machineType: "e2-micro", * subnetId: "https://www.googleapis.com/compute/v1/projects/project_id/regions/region/subnetworks/subnet_name", * apiKey: "", * allocateStaticIp: false, * certificates: { * keySecretId: "projects/project_id/secrets/secret_id/versions/1", * certSecretId: "projects/project_id/secrets/secret_id/versions/1", * }, * deleteCloudResourcesOnDestroy: false, * }); * ``` */ class GcpProxy extends pulumi.CustomResource { /** * Get an existing GcpProxy 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 GcpProxy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of GcpProxy. 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'] === GcpProxy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allocateStaticIp"] = state?.allocateStaticIp; resourceInputs["apiKey"] = state?.apiKey; resourceInputs["certificates"] = state?.certificates; resourceInputs["cloudConnectorId"] = state?.cloudConnectorId; resourceInputs["deleteCloudResourcesOnDestroy"] = state?.deleteCloudResourcesOnDestroy; resourceInputs["hostName"] = state?.hostName; resourceInputs["identifier"] = state?.identifier; resourceInputs["machineType"] = state?.machineType; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["securityGroups"] = state?.securityGroups; resourceInputs["subnetId"] = state?.subnetId; resourceInputs["vpc"] = state?.vpc; resourceInputs["zone"] = state?.zone; } 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?.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?.subnetId === undefined && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } if (args?.vpc === undefined && !opts.urn) { throw new Error("Missing required property 'vpc'"); } if (args?.zone === undefined && !opts.urn) { throw new Error("Missing required property 'zone'"); } resourceInputs["allocateStaticIp"] = args?.allocateStaticIp; resourceInputs["apiKey"] = args?.apiKey ? pulumi.secret(args.apiKey) : undefined; resourceInputs["certificates"] = args?.certificates; resourceInputs["cloudConnectorId"] = args?.cloudConnectorId; resourceInputs["deleteCloudResourcesOnDestroy"] = args?.deleteCloudResourcesOnDestroy; resourceInputs["hostName"] = args?.hostName; resourceInputs["machineType"] = args?.machineType; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["securityGroups"] = args?.securityGroups; resourceInputs["subnetId"] = args?.subnetId; resourceInputs["vpc"] = args?.vpc; resourceInputs["zone"] = args?.zone; resourceInputs["identifier"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["apiKey"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(GcpProxy.__pulumiType, name, resourceInputs, opts); } } exports.GcpProxy = GcpProxy; /** @internal */ GcpProxy.__pulumiType = 'harness:autostopping/gcpProxy:GcpProxy'; //# sourceMappingURL=gcpProxy.js.map