@pulumi/kubernetes
Version:
[](https://github.com/pulumi/pulumi-kubernetes/actions) [](https://slack.pulumi.com) [;
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomResource = void 0;
// *** WARNING: this file was generated by pulumigen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* CustomResource represents an instance of a CustomResourceDefinition (CRD). For example, the
* CoreOS Prometheus operator exposes a CRD `monitoring.coreos.com/ServiceMonitor`; to
* instantiate this as a Pulumi resource, one could call `new CustomResource`, passing the
* `ServiceMonitor` resource definition as an argument.
*/
class CustomResource extends pulumi.CustomResource {
/**
* Get an existing CustomResource 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 opts Uniquely specifies a CustomResource to select.
*/
static get(name, opts) {
// NOTE: `selectOpts` will be type `pulumi.CustomResource`. If we add a field that does
// not satisfy that interface, it will cause a compilation error in `...selectOpts` in
// the constructor call below.
const { apiVersion, kind, id, ...selectOpts } = opts;
return new CustomResource(name, { apiVersion: apiVersion, kind: kind }, { ...selectOpts, id: id });
}
getInputs() { return this.__inputs; }
__inputs;
/**
* Create a CustomResource 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 inputs = {};
opts = opts || {};
if (!opts.id) {
if ((!args || args.apiVersion === undefined) && !opts.urn) {
throw new Error("Missing required property 'apiVersion'");
}
if ((!args || args.kind === undefined) && !opts.urn) {
throw new Error("Missing required property 'kind'");
}
for (const key of Object.keys(args)) {
inputs[key] = args[key];
}
}
else {
for (const key of Object.keys(args)) {
inputs[key] = undefined;
}
}
if (!opts.version) {
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });
}
super(`kubernetes:${args.apiVersion}:${args.kind}`, name, inputs, opts);
this.__inputs = args;
}
}
exports.CustomResource = CustomResource;
//# sourceMappingURL=customResource.js.map