UNPKG

@pulumi/gcp

Version:

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

269 lines • 12 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.AttachedCluster = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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}} * ``` * * ```sh * $ pulumi import gcp:container/attachedCluster:AttachedCluster default {{project}}/{{location}}/{{name}} * ``` * * ```sh * $ 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.annotations : undefined; resourceInputs["authorization"] = state ? state.authorization : undefined; resourceInputs["binaryAuthorization"] = state ? state.binaryAuthorization : undefined; resourceInputs["clusterRegion"] = state ? state.clusterRegion : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["deletionPolicy"] = state ? state.deletionPolicy : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["distribution"] = state ? state.distribution : undefined; resourceInputs["effectiveAnnotations"] = state ? state.effectiveAnnotations : undefined; resourceInputs["errors"] = state ? state.errors : undefined; resourceInputs["fleet"] = state ? state.fleet : undefined; resourceInputs["kubernetesVersion"] = state ? state.kubernetesVersion : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["loggingConfig"] = state ? state.loggingConfig : undefined; resourceInputs["monitoringConfig"] = state ? state.monitoringConfig : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["oidcConfig"] = state ? state.oidcConfig : undefined; resourceInputs["platformVersion"] = state ? state.platformVersion : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["proxyConfig"] = state ? state.proxyConfig : undefined; resourceInputs["reconciling"] = state ? state.reconciling : undefined; resourceInputs["securityPostureConfig"] = state ? state.securityPostureConfig : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["uid"] = state ? state.uid : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; resourceInputs["workloadIdentityConfigs"] = state ? state.workloadIdentityConfigs : undefined; } else { const args = argsOrState; if ((!args || args.distribution === undefined) && !opts.urn) { throw new Error("Missing required property 'distribution'"); } if ((!args || args.fleet === undefined) && !opts.urn) { throw new Error("Missing required property 'fleet'"); } if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } if ((!args || args.oidcConfig === undefined) && !opts.urn) { throw new Error("Missing required property 'oidcConfig'"); } if ((!args || args.platformVersion === undefined) && !opts.urn) { throw new Error("Missing required property 'platformVersion'"); } resourceInputs["annotations"] = args ? args.annotations : undefined; resourceInputs["authorization"] = args ? args.authorization : undefined; resourceInputs["binaryAuthorization"] = args ? args.binaryAuthorization : undefined; resourceInputs["deletionPolicy"] = args ? args.deletionPolicy : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["distribution"] = args ? args.distribution : undefined; resourceInputs["fleet"] = args ? args.fleet : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["loggingConfig"] = args ? args.loggingConfig : undefined; resourceInputs["monitoringConfig"] = args ? args.monitoringConfig : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["oidcConfig"] = args ? args.oidcConfig : undefined; resourceInputs["platformVersion"] = args ? args.platformVersion : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["proxyConfig"] = args ? args.proxyConfig : undefined; resourceInputs["securityPostureConfig"] = args ? args.securityPostureConfig : undefined; 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; /** @internal */ AttachedCluster.__pulumiType = 'gcp:container/attachedCluster:AttachedCluster'; //# sourceMappingURL=attachedCluster.js.map