@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
135 lines • 7.65 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** 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");
/**
* ## Import
*
* Before importing a Kubernetes cluster, the cluster's default node pool must be tagged with
*
* the `terraform:default-node-pool` tag. The provider will automatically add this tag if
*
* the cluster only has a single node pool. Clusters with more than one node pool, however, will require
*
* that you manually add the `terraform:default-node-pool` tag to the node pool that you intend to be
*
* the default node pool.
*
* Then the Kubernetes cluster and its default node pool can be imported using the cluster's `id`, e.g.
*
* ```sh
* $ pulumi import digitalocean:index/kubernetesCluster:KubernetesCluster mycluster 1b8b2100-0e9f-4e8f-ad78-9eb578c2a0af
* ```
*
* Additional node pools must be imported separately as `digitalocean_kubernetes_cluster`
*
* resources, e.g.
*
* ```sh
* $ pulumi import digitalocean:index/kubernetesCluster:KubernetesCluster mynodepool 9d76f410-9284-4436-9633-4066852442c8
* ```
*/
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["autoUpgrade"] = state ? state.autoUpgrade : undefined;
resourceInputs["clusterAutoscalerConfigurations"] = state ? state.clusterAutoscalerConfigurations : undefined;
resourceInputs["clusterSubnet"] = state ? state.clusterSubnet : undefined;
resourceInputs["clusterUrn"] = state ? state.clusterUrn : undefined;
resourceInputs["controlPlaneFirewall"] = state ? state.controlPlaneFirewall : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["destroyAllAssociatedResources"] = state ? state.destroyAllAssociatedResources : undefined;
resourceInputs["endpoint"] = state ? state.endpoint : undefined;
resourceInputs["ha"] = state ? state.ha : undefined;
resourceInputs["ipv4Address"] = state ? state.ipv4Address : undefined;
resourceInputs["kubeConfigs"] = state ? state.kubeConfigs : undefined;
resourceInputs["kubeconfigExpireSeconds"] = state ? state.kubeconfigExpireSeconds : undefined;
resourceInputs["maintenancePolicy"] = state ? state.maintenancePolicy : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nodePool"] = state ? state.nodePool : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["registryIntegration"] = state ? state.registryIntegration : undefined;
resourceInputs["routingAgent"] = state ? state.routingAgent : undefined;
resourceInputs["serviceSubnet"] = state ? state.serviceSubnet : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["surgeUpgrade"] = state ? state.surgeUpgrade : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["version"] = state ? state.version : undefined;
resourceInputs["vpcUuid"] = state ? state.vpcUuid : undefined;
}
else {
const args = argsOrState;
if ((!args || args.nodePool === undefined) && !opts.urn) {
throw new Error("Missing required property 'nodePool'");
}
if ((!args || args.region === undefined) && !opts.urn) {
throw new Error("Missing required property 'region'");
}
if ((!args || args.version === undefined) && !opts.urn) {
throw new Error("Missing required property 'version'");
}
resourceInputs["autoUpgrade"] = args ? args.autoUpgrade : undefined;
resourceInputs["clusterAutoscalerConfigurations"] = args ? args.clusterAutoscalerConfigurations : undefined;
resourceInputs["clusterSubnet"] = args ? args.clusterSubnet : undefined;
resourceInputs["controlPlaneFirewall"] = args ? args.controlPlaneFirewall : undefined;
resourceInputs["destroyAllAssociatedResources"] = args ? args.destroyAllAssociatedResources : undefined;
resourceInputs["ha"] = args ? args.ha : undefined;
resourceInputs["kubeconfigExpireSeconds"] = args ? args.kubeconfigExpireSeconds : undefined;
resourceInputs["maintenancePolicy"] = args ? args.maintenancePolicy : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["nodePool"] = args ? args.nodePool : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["registryIntegration"] = args ? args.registryIntegration : undefined;
resourceInputs["routingAgent"] = args ? args.routingAgent : undefined;
resourceInputs["serviceSubnet"] = args ? args.serviceSubnet : undefined;
resourceInputs["surgeUpgrade"] = args ? args.surgeUpgrade : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["vpcUuid"] = args ? args.vpcUuid : undefined;
resourceInputs["clusterUrn"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["ipv4Address"] = undefined /*out*/;
resourceInputs["kubeConfigs"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = 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 = 'digitalocean:index/kubernetesCluster:KubernetesCluster';
//# sourceMappingURL=kubernetesCluster.js.map