@pulumi/kubernetes
Version:
[](https://travis-ci.com/pulumi/pulumi-kubernetes) [](https://slack.pulumi.com) [![NPM
98 lines • 4.33 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.ConfigFile = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../../utilities");
/**
* ConfigFile creates a set of Kubernetes resources from a remote or on-disk Kubernetes YAML file.
* (If you have in-memory YAML a ConfigGroup may be more appropriate.)
*
* ## Dependency ordering
* Sometimes resources must be applied in a specific order. For example, a namespace resource must be
* created before any namespaced resources, or a Custom Resource Definition (CRD) must be pre-installed.
*
* Pulumi uses heuristics to determine which order to apply and delete objects within the ConfigFile. Pulumi also
* waits for each object to be fully reconciled, unless `skipAwait` is enabled.
*
* ### Explicit Dependency Ordering
* Pulumi supports the `config.kubernetes.io/depends-on` annotation to declare an explicit dependency on a given resource.
* The annotation accepts a list of resource references, delimited by commas.
*
* Note that references to resources outside the ConfigFile aren't supported.
*
* **Resource reference**
*
* A resource reference is a string that uniquely identifies a resource.
*
* It consists of the group, kind, name, and optionally the namespace, delimited by forward slashes.
*
* | Resource Scope | Format |
* | :--------------- | :--------------------------------------------- |
* | namespace-scoped | `<group>/namespaces/<namespace>/<kind>/<name>` |
* | cluster-scoped | `<group>/<kind>/<name>` |
*
* For resources in the “core” group, the empty string is used instead (for example: `/namespaces/test/Pod/pod-a`).
*
* ### Ordering across ConfigFiles
* The `dependsOn` resource option creates a list of explicit dependencies between Pulumi resources.
* Use it on another resource to make it dependent on the ConfigFile and to wait for the resources within
* the group to be deployed.
*
* A best practice is to deploy each application using its own ConfigFile, especially when that application
* installs custom resource definitions.
*
* ## Example Usage
* ### Local File
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as k8s from "@pulumi/kubernetes";
*
* const example = new k8s.yaml.v2.ConfigFile("example", {
* files: ["./manifest.yaml"],
* });
* ```
* {% /examples %}}
*/
class ConfigFile extends pulumi.ComponentResource {
/**
* Returns true if the given object is an instance of ConfigFile. 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'] === ConfigFile.__pulumiType;
}
/**
* Create a ConfigFile 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.file === undefined) && !opts.urn) {
throw new Error("Missing required property 'file'");
}
resourceInputs["file"] = args ? args.file : undefined;
resourceInputs["resourcePrefix"] = args ? args.resourcePrefix : undefined;
resourceInputs["skipAwait"] = args ? args.skipAwait : undefined;
resourceInputs["resources"] = undefined /*out*/;
}
else {
resourceInputs["resources"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ConfigFile.__pulumiType, name, resourceInputs, opts, true /*remote*/);
}
}
exports.ConfigFile = ConfigFile;
/** @internal */
ConfigFile.__pulumiType = 'kubernetes:yaml/v2:ConfigFile';
//# sourceMappingURL=configFile.js.map