@pulumiverse/cpln
Version:
A Pulumi package for creating and managing Control Plane (cpln) resources.
113 lines • 4.15 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.Mk8sKubeconfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Obtain the Cluster’s Kubeconfig.
*
* ## Declaration
*
* ### Required
*
* - **name** (String) Name of the Mk8s.
*
* > **Note** Only one of the below can be included in the resource.
*
* - **profile** (String) The name of the cpln profile used to generate the kubeconfig file for authenticating with your Kubernetes cluster.
* - **service_account** (String) The name of an existing service account for which a key will be generated, enabling kubeconfig-based authentication with your Kubernetes cluster.
*
* ## Outputs
*
* The following attributes are exported:
*
* - **kubeconfig** (String) The Kubeconfig in YAML format.
*
* ## Example Usage
*
* ### Profile
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cpln from "@pulumiverse/cpln";
*
* export = async () => {
* const _new = new cpln.Mk8sKubeconfig("new", {
* name: "generic-cluster",
* profile: "default",
* });
* return {
* "generic-cluster-kubeconfig": _new.kubeconfig,
* };
* }
* ```
*
* ### Service Account
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cpln from "@pulumiverse/cpln";
*
* export = async () => {
* const _new = new cpln.Mk8sKubeconfig("new", {
* name: "generic-cluster",
* serviceAccount: "devops-sa",
* });
* return {
* "generic-cluster-kubeconfig": _new.kubeconfig,
* };
* }
* ```
*/
class Mk8sKubeconfig extends pulumi.CustomResource {
/**
* Get an existing Mk8sKubeconfig 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 Mk8sKubeconfig(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Mk8sKubeconfig. 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'] === Mk8sKubeconfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["kubeconfig"] = state ? state.kubeconfig : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["profile"] = state ? state.profile : undefined;
resourceInputs["serviceAccount"] = state ? state.serviceAccount : undefined;
}
else {
const args = argsOrState;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["profile"] = args ? args.profile : undefined;
resourceInputs["serviceAccount"] = args ? args.serviceAccount : undefined;
resourceInputs["kubeconfig"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["kubeconfig"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Mk8sKubeconfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.Mk8sKubeconfig = Mk8sKubeconfig;
/** @internal */
Mk8sKubeconfig.__pulumiType = 'cpln:index/mk8sKubeconfig:Mk8sKubeconfig';
//# sourceMappingURL=mk8sKubeconfig.js.map