UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

262 lines • 11.3 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.WorkstationCluster = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ### Workstation Cluster Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const defaultNetwork = new gcp.compute.Network("default", { * name: "workstation-cluster", * autoCreateSubnetworks: false, * }); * const defaultSubnetwork = new gcp.compute.Subnetwork("default", { * name: "workstation-cluster", * ipCidrRange: "10.0.0.0/24", * region: "us-central1", * network: defaultNetwork.name, * }); * const _default = new gcp.workstations.WorkstationCluster("default", { * workstationClusterId: "workstation-cluster", * network: defaultNetwork.id, * subnetwork: defaultSubnetwork.id, * location: "us-central1", * labels: { * label: "key", * }, * annotations: { * "label-one": "value-one", * }, * }); * const project = gcp.organizations.getProject({}); * ``` * ### Workstation Cluster Private * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const defaultNetwork = new gcp.compute.Network("default", { * name: "workstation-cluster-private", * autoCreateSubnetworks: false, * }); * const defaultSubnetwork = new gcp.compute.Subnetwork("default", { * name: "workstation-cluster-private", * ipCidrRange: "10.0.0.0/24", * region: "us-central1", * network: defaultNetwork.name, * }); * const _default = new gcp.workstations.WorkstationCluster("default", { * workstationClusterId: "workstation-cluster-private", * network: defaultNetwork.id, * subnetwork: defaultSubnetwork.id, * location: "us-central1", * privateClusterConfig: { * enablePrivateEndpoint: true, * }, * labels: { * label: "key", * }, * annotations: { * "label-one": "value-one", * }, * }); * const project = gcp.organizations.getProject({}); * ``` * ### Workstation Cluster Custom Domain * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const defaultNetwork = new gcp.compute.Network("default", { * name: "workstation-cluster-custom-domain", * autoCreateSubnetworks: false, * }); * const defaultSubnetwork = new gcp.compute.Subnetwork("default", { * name: "workstation-cluster-custom-domain", * ipCidrRange: "10.0.0.0/24", * region: "us-central1", * network: defaultNetwork.name, * }); * const _default = new gcp.workstations.WorkstationCluster("default", { * workstationClusterId: "workstation-cluster-custom-domain", * network: defaultNetwork.id, * subnetwork: defaultSubnetwork.id, * location: "us-central1", * privateClusterConfig: { * enablePrivateEndpoint: true, * }, * domainConfig: { * domain: "workstations.example.com", * }, * labels: { * label: "key", * }, * annotations: { * "label-one": "value-one", * }, * }); * const project = gcp.organizations.getProject({}); * ``` * ### Workstation Cluster Tags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const tagKey = new gcp.tags.TagKey("tag_key", { * parent: project.then(project => `projects/${project.number}`), * shortName: "keyname", * }); * const tagValue = new gcp.tags.TagValue("tag_value", { * parent: pulumi.interpolate`tagKeys/${tagKey.name}`, * shortName: "valuename", * }); * const defaultNetwork = new gcp.compute.Network("default", { * name: "workstation-cluster-tags", * autoCreateSubnetworks: false, * }); * const defaultSubnetwork = new gcp.compute.Subnetwork("default", { * name: "workstation-cluster-tags", * ipCidrRange: "10.0.0.0/24", * region: "us-central1", * network: defaultNetwork.name, * }); * const _default = new gcp.workstations.WorkstationCluster("default", { * workstationClusterId: "workstation-cluster-tags", * network: defaultNetwork.id, * subnetwork: defaultSubnetwork.id, * location: "us-central1", * tags: pulumi.all([project, tagKey.shortName, tagValue.shortName]).apply(([project, tagKeyShortName, tagValueShortName]) => { * [`${project.projectId}/${tagKeyShortName}`]: tagValueShortName, * }), * }); * ``` * * ## Import * * WorkstationCluster can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}` * * * `{{project}}/{{location}}/{{workstation_cluster_id}}` * * * `{{location}}/{{workstation_cluster_id}}` * * When using the `pulumi import` command, WorkstationCluster can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:workstations/workstationCluster:WorkstationCluster default projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}} * ``` * * ```sh * $ pulumi import gcp:workstations/workstationCluster:WorkstationCluster default {{project}}/{{location}}/{{workstation_cluster_id}} * ``` * * ```sh * $ pulumi import gcp:workstations/workstationCluster:WorkstationCluster default {{location}}/{{workstation_cluster_id}} * ``` */ class WorkstationCluster extends pulumi.CustomResource { /** * Get an existing WorkstationCluster 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 WorkstationCluster(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of WorkstationCluster. 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'] === WorkstationCluster.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["annotations"] = state ? state.annotations : undefined; resourceInputs["conditions"] = state ? state.conditions : undefined; resourceInputs["controlPlaneIp"] = state ? state.controlPlaneIp : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["degraded"] = state ? state.degraded : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["domainConfig"] = state ? state.domainConfig : undefined; resourceInputs["effectiveAnnotations"] = state ? state.effectiveAnnotations : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["network"] = state ? state.network : undefined; resourceInputs["privateClusterConfig"] = state ? state.privateClusterConfig : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["subnetwork"] = state ? state.subnetwork : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["uid"] = state ? state.uid : undefined; resourceInputs["workstationClusterId"] = state ? state.workstationClusterId : undefined; } else { const args = argsOrState; if ((!args || args.network === undefined) && !opts.urn) { throw new Error("Missing required property 'network'"); } if ((!args || args.subnetwork === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetwork'"); } if ((!args || args.workstationClusterId === undefined) && !opts.urn) { throw new Error("Missing required property 'workstationClusterId'"); } resourceInputs["annotations"] = args ? args.annotations : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["domainConfig"] = args ? args.domainConfig : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["network"] = args ? args.network : undefined; resourceInputs["privateClusterConfig"] = args ? args.privateClusterConfig : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["subnetwork"] = args ? args.subnetwork : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["workstationClusterId"] = args ? args.workstationClusterId : undefined; resourceInputs["conditions"] = undefined /*out*/; resourceInputs["controlPlaneIp"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["degraded"] = undefined /*out*/; resourceInputs["effectiveAnnotations"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["uid"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(WorkstationCluster.__pulumiType, name, resourceInputs, opts); } } exports.WorkstationCluster = WorkstationCluster; /** @internal */ WorkstationCluster.__pulumiType = 'gcp:workstations/workstationCluster:WorkstationCluster'; //# sourceMappingURL=workstationCluster.js.map