UNPKG

@pulumi/gcp

Version:

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

284 lines • 12.2 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AttachedCluster = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * An Anthos cluster running on customer owned infrastructure. * * To get more information about Cluster, see: * * * [API documentation](https://cloud.google.com/anthos/clusters/docs/multi-cloud/reference/rest) * * How-to Guides * * [API reference](https://cloud.google.com/anthos/clusters/docs/multi-cloud/reference/rest/v1/projects.locations.attachedClusters) * * [Multicloud overview](https://cloud.google.com/anthos/clusters/docs/multi-cloud) * * ## Example Usage * * ### Container Attached Cluster Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const versions = project.then(project => gcp.container.getAttachedVersions({ * location: "us-west1", * project: project.projectId, * })); * const primary = new gcp.container.AttachedCluster("primary", { * name: "basic", * location: "us-west1", * project: project.then(project => project.projectId), * description: "Test cluster", * distribution: "aks", * oidcConfig: { * issuerUrl: "https://oidc.issuer.url", * }, * platformVersion: versions.then(versions => versions.validVersions?.[0]), * fleet: { * project: project.then(project => `projects/${project.number}`), * }, * }); * ``` * ### Container Attached Cluster Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const project = gcp.organizations.getProject({}); * const versions = project.then(project => gcp.container.getAttachedVersions({ * location: "us-west1", * project: project.projectId, * })); * const primary = new gcp.container.AttachedCluster("primary", { * name: "basic", * project: project.then(project => project.projectId), * location: "us-west1", * description: "Test cluster", * distribution: "aks", * annotations: { * "label-one": "value-one", * }, * authorization: { * adminUsers: [ * "user1@example.com", * "user2@example.com", * ], * adminGroups: [ * "group1@example.com", * "group2@example.com", * ], * }, * oidcConfig: { * issuerUrl: "https://oidc.issuer.url", * jwks: std.base64encode({ * input: "{\"keys\":[{\"use\":\"sig\",\"kty\":\"RSA\",\"kid\":\"testid\",\"alg\":\"RS256\",\"n\":\"somedata\",\"e\":\"AQAB\"}]}", * }).then(invoke => invoke.result), * }, * platformVersion: versions.then(versions => versions.validVersions?.[0]), * fleet: { * project: project.then(project => `projects/${project.number}`), * }, * loggingConfig: { * componentConfig: { * enableComponents: [ * "SYSTEM_COMPONENTS", * "WORKLOADS", * ], * }, * }, * monitoringConfig: { * managedPrometheusConfig: { * enabled: true, * }, * }, * binaryAuthorization: { * evaluationMode: "PROJECT_SINGLETON_POLICY_ENFORCE", * }, * proxyConfig: { * kubernetesSecret: { * name: "proxy-config", * namespace: "default", * }, * }, * }); * ``` * ### Container Attached Cluster Ignore Errors * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const versions = project.then(project => gcp.container.getAttachedVersions({ * location: "us-west1", * project: project.projectId, * })); * const primary = new gcp.container.AttachedCluster("primary", { * name: "basic", * location: "us-west1", * project: project.then(project => project.projectId), * description: "Test cluster", * distribution: "aks", * oidcConfig: { * issuerUrl: "https://oidc.issuer.url", * }, * platformVersion: versions.then(versions => versions.validVersions?.[0]), * fleet: { * project: project.then(project => `projects/${project.number}`), * }, * deletionPolicy: "DELETE_IGNORE_ERRORS", * }); * ``` * * ## Import * * Cluster can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/attachedClusters/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, Cluster can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:container/attachedCluster:AttachedCluster default projects/{{project}}/locations/{{location}}/attachedClusters/{{name}} * $ pulumi import gcp:container/attachedCluster:AttachedCluster default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:container/attachedCluster:AttachedCluster default {{location}}/{{name}} * ``` */ class AttachedCluster extends pulumi.CustomResource { /** * Get an existing AttachedCluster 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 AttachedCluster(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:container/attachedCluster:AttachedCluster'; /** * Returns true if the given object is an instance of AttachedCluster. 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'] === AttachedCluster.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["annotations"] = state?.annotations; resourceInputs["authorization"] = state?.authorization; resourceInputs["binaryAuthorization"] = state?.binaryAuthorization; resourceInputs["clusterRegion"] = state?.clusterRegion; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["distribution"] = state?.distribution; resourceInputs["effectiveAnnotations"] = state?.effectiveAnnotations; resourceInputs["errors"] = state?.errors; resourceInputs["fleet"] = state?.fleet; resourceInputs["kubernetesVersion"] = state?.kubernetesVersion; resourceInputs["location"] = state?.location; resourceInputs["loggingConfig"] = state?.loggingConfig; resourceInputs["monitoringConfig"] = state?.monitoringConfig; resourceInputs["name"] = state?.name; resourceInputs["oidcConfig"] = state?.oidcConfig; resourceInputs["platformVersion"] = state?.platformVersion; resourceInputs["project"] = state?.project; resourceInputs["proxyConfig"] = state?.proxyConfig; resourceInputs["reconciling"] = state?.reconciling; resourceInputs["securityPostureConfig"] = state?.securityPostureConfig; resourceInputs["state"] = state?.state; resourceInputs["uid"] = state?.uid; resourceInputs["updateTime"] = state?.updateTime; resourceInputs["workloadIdentityConfigs"] = state?.workloadIdentityConfigs; } else { const args = argsOrState; if (args?.distribution === undefined && !opts.urn) { throw new Error("Missing required property 'distribution'"); } if (args?.fleet === undefined && !opts.urn) { throw new Error("Missing required property 'fleet'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.oidcConfig === undefined && !opts.urn) { throw new Error("Missing required property 'oidcConfig'"); } if (args?.platformVersion === undefined && !opts.urn) { throw new Error("Missing required property 'platformVersion'"); } resourceInputs["annotations"] = args?.annotations; resourceInputs["authorization"] = args?.authorization; resourceInputs["binaryAuthorization"] = args?.binaryAuthorization; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["distribution"] = args?.distribution; resourceInputs["fleet"] = args?.fleet; resourceInputs["location"] = args?.location; resourceInputs["loggingConfig"] = args?.loggingConfig; resourceInputs["monitoringConfig"] = args?.monitoringConfig; resourceInputs["name"] = args?.name; resourceInputs["oidcConfig"] = args?.oidcConfig; resourceInputs["platformVersion"] = args?.platformVersion; resourceInputs["project"] = args?.project; resourceInputs["proxyConfig"] = args?.proxyConfig; resourceInputs["securityPostureConfig"] = args?.securityPostureConfig; resourceInputs["clusterRegion"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveAnnotations"] = undefined /*out*/; resourceInputs["errors"] = undefined /*out*/; resourceInputs["kubernetesVersion"] = undefined /*out*/; resourceInputs["reconciling"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["uid"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; resourceInputs["workloadIdentityConfigs"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AttachedCluster.__pulumiType, name, resourceInputs, opts); } } exports.AttachedCluster = AttachedCluster; //# sourceMappingURL=attachedCluster.js.map