@pulumi/kubernetes
Version:
[](https://travis-ci.com/pulumi/pulumi-kubernetes) [](https://slack.pulumi.com) [![NPM
69 lines • 3.54 kB
JavaScript
;
// *** WARNING: this file was generated by pulumigen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClusterRoleBinding = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../../utilities");
/**
* ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.20.
*/
class ClusterRoleBinding extends pulumi.CustomResource {
/**
* Get an existing ClusterRoleBinding 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 opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, opts) {
return new ClusterRoleBinding(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ClusterRoleBinding. 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'] === ClusterRoleBinding.__pulumiType;
}
/**
* Create a ClusterRoleBinding resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
if ((!args || args.roleRef === undefined) && !opts.urn) {
throw new Error("Missing required property 'roleRef'");
}
resourceInputs["apiVersion"] = "rbac.authorization.k8s.io/v1alpha1";
resourceInputs["kind"] = "ClusterRoleBinding";
resourceInputs["metadata"] = args ? args.metadata : undefined;
resourceInputs["roleRef"] = args ? args.roleRef : undefined;
resourceInputs["subjects"] = args ? args.subjects : undefined;
}
else {
resourceInputs["apiVersion"] = undefined /*out*/;
resourceInputs["kind"] = undefined /*out*/;
resourceInputs["metadata"] = undefined /*out*/;
resourceInputs["roleRef"] = undefined /*out*/;
resourceInputs["subjects"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "kubernetes:rbac.authorization.k8s.io/v1:ClusterRoleBinding" }, { type: "kubernetes:rbac.authorization.k8s.io/v1beta1:ClusterRoleBinding" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(ClusterRoleBinding.__pulumiType, name, resourceInputs, opts);
}
}
exports.ClusterRoleBinding = ClusterRoleBinding;
/** @internal */
ClusterRoleBinding.__pulumiType = 'kubernetes:rbac.authorization.k8s.io/v1alpha1:ClusterRoleBinding';
//# sourceMappingURL=clusterRoleBinding.js.map