@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
112 lines (111 loc) • 3.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as kubernetes from "@pulumi/kubernetes";
* import * as local from "@pulumi/local";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Use Kubernetes provider to access your Kubernetes cluster
* // Create a network for the Kubernetes cluster
* const exampleNetwork = new upcloud.Network("example", {
* name: "example-network",
* zone: "de-fra1",
* ipNetwork: {
* address: "172.16.1.0/24",
* dhcp: true,
* family: "IPv4",
* },
* });
* // Create a Kubernetes cluster
* const exampleKubernetesCluster = new upcloud.KubernetesCluster("example", {
* controlPlaneIpFilters: ["0.0.0.0/0"],
* name: "exampleapp",
* network: exampleNetwork.id,
* zone: "de-fra1",
* });
* // Read the details of the newly created cluster
* const example = upcloud.getKubernetesClusterOutput({
* id: exampleKubernetesCluster.id,
* });
* // Use the Kubernetes provider resources to interact with the cluster
* const exampleNamespace = new kubernetes.index.Namespace("example", {metadata: [{
* name: "example-namespace",
* }]});
* // In addition, write the kubeconfig to a file to interact with the cluster with `kubectl` or other clients
* const exampleFile = new local.index.File("example", {
* content: example.kubeconfig,
* filename: "example.conf",
* });
* ```
*/
export declare function getKubernetesCluster(args: GetKubernetesClusterArgs, opts?: pulumi.InvokeOptions): Promise<GetKubernetesClusterResult>;
/**
* A collection of arguments for invoking getKubernetesCluster.
*/
export interface GetKubernetesClusterArgs {
id: string;
}
/**
* A collection of values returned by getKubernetesCluster.
*/
export interface GetKubernetesClusterResult {
readonly clientCertificate: string;
readonly clientKey: string;
readonly clusterCaCertificate: string;
readonly host: string;
readonly id: string;
readonly kubeconfig: string;
readonly name: string;
}
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as kubernetes from "@pulumi/kubernetes";
* import * as local from "@pulumi/local";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Use Kubernetes provider to access your Kubernetes cluster
* // Create a network for the Kubernetes cluster
* const exampleNetwork = new upcloud.Network("example", {
* name: "example-network",
* zone: "de-fra1",
* ipNetwork: {
* address: "172.16.1.0/24",
* dhcp: true,
* family: "IPv4",
* },
* });
* // Create a Kubernetes cluster
* const exampleKubernetesCluster = new upcloud.KubernetesCluster("example", {
* controlPlaneIpFilters: ["0.0.0.0/0"],
* name: "exampleapp",
* network: exampleNetwork.id,
* zone: "de-fra1",
* });
* // Read the details of the newly created cluster
* const example = upcloud.getKubernetesClusterOutput({
* id: exampleKubernetesCluster.id,
* });
* // Use the Kubernetes provider resources to interact with the cluster
* const exampleNamespace = new kubernetes.index.Namespace("example", {metadata: [{
* name: "example-namespace",
* }]});
* // In addition, write the kubeconfig to a file to interact with the cluster with `kubectl` or other clients
* const exampleFile = new local.index.File("example", {
* content: example.kubeconfig,
* filename: "example.conf",
* });
* ```
*/
export declare function getKubernetesClusterOutput(args: GetKubernetesClusterOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetKubernetesClusterResult>;
/**
* A collection of arguments for invoking getKubernetesCluster.
*/
export interface GetKubernetesClusterOutputArgs {
id: pulumi.Input<string>;
}