@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
245 lines • 11 kB
JavaScript
;
// *** 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.Cluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Cluster contains information about a Google Distributed Cloud Edge Kubernetes cluster.
*
* To get more information about Cluster, see:
*
* * [API documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/container/rest/v1/projects.locations.clusters)
* * How-to Guides
* * [Create and manage clusters](https://cloud.google.com/distributed-cloud/edge/latest/docs/clusters)
*
* ## Example Usage
*
* ### Edgecontainer Cluster
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const _default = new gcp.edgecontainer.Cluster("default", {
* name: "basic-cluster",
* location: "us-central1",
* authorization: {
* adminUsers: {
* username: "admin@hashicorptest.com",
* },
* },
* networking: {
* clusterIpv4CidrBlocks: ["10.0.0.0/16"],
* servicesIpv4CidrBlocks: ["10.1.0.0/16"],
* },
* fleet: {
* project: project.then(project => `projects/${project.number}`),
* },
* labels: {
* my_key: "my_val",
* other_key: "other_val",
* },
* });
* ```
* ### Edgecontainer Cluster With Maintenance Window
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const _default = new gcp.edgecontainer.Cluster("default", {
* name: "cluster-with-maintenance",
* location: "us-central1",
* authorization: {
* adminUsers: {
* username: "admin@hashicorptest.com",
* },
* },
* networking: {
* clusterIpv4CidrBlocks: ["10.0.0.0/16"],
* servicesIpv4CidrBlocks: ["10.1.0.0/16"],
* },
* fleet: {
* project: project.then(project => `projects/${project.number}`),
* },
* maintenancePolicy: {
* window: {
* recurringWindow: {
* window: {
* startTime: "2023-01-01T08:00:00Z",
* endTime: "2023-01-01T17:00:00Z",
* },
* recurrence: "FREQ=WEEKLY;BYDAY=SA",
* },
* },
* },
* });
* ```
* ### Edgecontainer Local Control Plane Cluster
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const _default = new gcp.edgecontainer.Cluster("default", {
* name: "local-control-plane-cluster",
* location: "us-central1",
* authorization: {
* adminUsers: {
* username: "admin@hashicorptest.com",
* },
* },
* networking: {
* clusterIpv4CidrBlocks: ["10.0.0.0/16"],
* servicesIpv4CidrBlocks: ["10.1.0.0/16"],
* },
* fleet: {
* project: project.then(project => `projects/${project.number}`),
* },
* externalLoadBalancerIpv4AddressPools: ["10.100.0.0-10.100.0.10"],
* controlPlane: {
* local: {
* nodeLocation: "us-central1-edge-example-edgesite",
* nodeCount: 1,
* machineFilter: "machine-name",
* sharedDeploymentPolicy: "ALLOWED",
* },
* },
* });
* ```
*
* ## Import
*
* Cluster can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/clusters/{{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:edgecontainer/cluster:Cluster default projects/{{project}}/locations/{{location}}/clusters/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:edgecontainer/cluster:Cluster default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:edgecontainer/cluster:Cluster default {{location}}/{{name}}
* ```
*/
class Cluster extends pulumi.CustomResource {
/**
* Get an existing Cluster 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 Cluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Cluster. 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'] === Cluster.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["authorization"] = state ? state.authorization : undefined;
resourceInputs["clusterCaCertificate"] = state ? state.clusterCaCertificate : undefined;
resourceInputs["controlPlane"] = state ? state.controlPlane : undefined;
resourceInputs["controlPlaneEncryption"] = state ? state.controlPlaneEncryption : undefined;
resourceInputs["controlPlaneVersion"] = state ? state.controlPlaneVersion : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["defaultMaxPodsPerNode"] = state ? state.defaultMaxPodsPerNode : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["endpoint"] = state ? state.endpoint : undefined;
resourceInputs["externalLoadBalancerIpv4AddressPools"] = state ? state.externalLoadBalancerIpv4AddressPools : undefined;
resourceInputs["fleet"] = state ? state.fleet : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["maintenanceEvents"] = state ? state.maintenanceEvents : undefined;
resourceInputs["maintenancePolicy"] = state ? state.maintenancePolicy : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["networking"] = state ? state.networking : undefined;
resourceInputs["nodeVersion"] = state ? state.nodeVersion : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
resourceInputs["releaseChannel"] = state ? state.releaseChannel : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["systemAddonsConfig"] = state ? state.systemAddonsConfig : undefined;
resourceInputs["targetVersion"] = state ? state.targetVersion : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
if ((!args || args.authorization === undefined) && !opts.urn) {
throw new Error("Missing required property 'authorization'");
}
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.networking === undefined) && !opts.urn) {
throw new Error("Missing required property 'networking'");
}
resourceInputs["authorization"] = args ? args.authorization : undefined;
resourceInputs["controlPlane"] = args ? args.controlPlane : undefined;
resourceInputs["controlPlaneEncryption"] = args ? args.controlPlaneEncryption : undefined;
resourceInputs["defaultMaxPodsPerNode"] = args ? args.defaultMaxPodsPerNode : undefined;
resourceInputs["externalLoadBalancerIpv4AddressPools"] = args ? args.externalLoadBalancerIpv4AddressPools : undefined;
resourceInputs["fleet"] = args ? args.fleet : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["maintenancePolicy"] = args ? args.maintenancePolicy : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["networking"] = args ? args.networking : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["releaseChannel"] = args ? args.releaseChannel : undefined;
resourceInputs["systemAddonsConfig"] = args ? args.systemAddonsConfig : undefined;
resourceInputs["targetVersion"] = args ? args.targetVersion : undefined;
resourceInputs["clusterCaCertificate"] = undefined /*out*/;
resourceInputs["controlPlaneVersion"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["maintenanceEvents"] = undefined /*out*/;
resourceInputs["nodeVersion"] = undefined /*out*/;
resourceInputs["port"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["clusterCaCertificate", "effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Cluster.__pulumiType, name, resourceInputs, opts);
}
}
exports.Cluster = Cluster;
/** @internal */
Cluster.__pulumiType = 'gcp:edgecontainer/cluster:Cluster';
//# sourceMappingURL=cluster.js.map