@lbrlabs/pulumi-scaleway
Version:
A Pulumi package for creating and managing scaleway cloud resources.
195 lines • 9.04 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.KubernetesCluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Creates and manages Scaleway Kubernetes clusters. For more information, see [the documentation](https://developers.scaleway.com/en/products/k8s/api/).
*
* ## Examples
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const jack = new scaleway.KubernetesCluster("jack", {
* version: "1.24.3",
* cni: "cilium",
* deleteAdditionalResources: false,
* });
* const john = new scaleway.KubernetesNodePool("john", {
* clusterId: jack.id,
* nodeType: "DEV1-M",
* size: 1,
* });
* ```
*
* ### Multicloud
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const henry = new scaleway.KubernetesCluster("henry", {
* type: "multicloud",
* version: "1.24.3",
* cni: "kilo",
* deleteAdditionalResources: false,
* });
* const friendFromOuterSpace = new scaleway.KubernetesNodePool("friendFromOuterSpace", {
* clusterId: henry.id,
* nodeType: "external",
* size: 0,
* minSize: 0,
* });
* ```
*
* For a detailed example of how to add or run Elastic Metal servers instead of instances on your cluster, please refer to this guide.
*
* ### With additional configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const johnKubernetesCluster = new scaleway.KubernetesCluster("johnKubernetesCluster", {
* description: "my awesome cluster",
* version: "1.24.3",
* cni: "calico",
* tags: [
* "i'm an awesome tag",
* "yay",
* ],
* deleteAdditionalResources: false,
* autoscalerConfig: {
* disableScaleDown: false,
* scaleDownDelayAfterAdd: "5m",
* estimator: "binpacking",
* expander: "random",
* ignoreDaemonsetsUtilization: true,
* balanceSimilarNodeGroups: true,
* expendablePodsPriorityCutoff: -5,
* },
* });
* const johnKubernetesNodePool = new scaleway.KubernetesNodePool("johnKubernetesNodePool", {
* clusterId: johnKubernetesCluster.id,
* nodeType: "DEV1-M",
* size: 3,
* autoscaling: true,
* autohealing: true,
* minSize: 1,
* maxSize: 5,
* });
* ```
*
* ## Import
*
* Kubernetes clusters can be imported using the `{region}/{id}`, e.g. bash
*
* ```sh
* $ pulumi import scaleway:index/kubernetesCluster:KubernetesCluster mycluster fr-par/11111111-1111-1111-1111-111111111111
* ```
*/
class KubernetesCluster extends pulumi.CustomResource {
/**
* Get an existing KubernetesCluster 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 KubernetesCluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of KubernetesCluster. 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'] === KubernetesCluster.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["admissionPlugins"] = state ? state.admissionPlugins : undefined;
resourceInputs["apiserverCertSans"] = state ? state.apiserverCertSans : undefined;
resourceInputs["apiserverUrl"] = state ? state.apiserverUrl : undefined;
resourceInputs["autoUpgrade"] = state ? state.autoUpgrade : undefined;
resourceInputs["autoscalerConfig"] = state ? state.autoscalerConfig : undefined;
resourceInputs["cni"] = state ? state.cni : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["deleteAdditionalResources"] = state ? state.deleteAdditionalResources : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["featureGates"] = state ? state.featureGates : undefined;
resourceInputs["kubeconfigs"] = state ? state.kubeconfigs : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["openIdConnectConfig"] = state ? state.openIdConnectConfig : undefined;
resourceInputs["organizationId"] = state ? state.organizationId : undefined;
resourceInputs["privateNetworkId"] = state ? state.privateNetworkId : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["upgradeAvailable"] = state ? state.upgradeAvailable : undefined;
resourceInputs["version"] = state ? state.version : undefined;
resourceInputs["wildcardDns"] = state ? state.wildcardDns : undefined;
}
else {
const args = argsOrState;
if ((!args || args.cni === undefined) && !opts.urn) {
throw new Error("Missing required property 'cni'");
}
if ((!args || args.deleteAdditionalResources === undefined) && !opts.urn) {
throw new Error("Missing required property 'deleteAdditionalResources'");
}
if ((!args || args.version === undefined) && !opts.urn) {
throw new Error("Missing required property 'version'");
}
resourceInputs["admissionPlugins"] = args ? args.admissionPlugins : undefined;
resourceInputs["apiserverCertSans"] = args ? args.apiserverCertSans : undefined;
resourceInputs["autoUpgrade"] = args ? args.autoUpgrade : undefined;
resourceInputs["autoscalerConfig"] = args ? args.autoscalerConfig : undefined;
resourceInputs["cni"] = args ? args.cni : undefined;
resourceInputs["deleteAdditionalResources"] = args ? args.deleteAdditionalResources : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["featureGates"] = args ? args.featureGates : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["openIdConnectConfig"] = args ? args.openIdConnectConfig : undefined;
resourceInputs["privateNetworkId"] = args ? args.privateNetworkId : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["apiserverUrl"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["kubeconfigs"] = undefined /*out*/;
resourceInputs["organizationId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
resourceInputs["upgradeAvailable"] = undefined /*out*/;
resourceInputs["wildcardDns"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["kubeconfigs"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(KubernetesCluster.__pulumiType, name, resourceInputs, opts);
}
}
exports.KubernetesCluster = KubernetesCluster;
/** @internal */
KubernetesCluster.__pulumiType = 'scaleway:index/kubernetesCluster:KubernetesCluster';
//# sourceMappingURL=kubernetesCluster.js.map