@pulumi/kubernetes
Version:
[](https://github.com/pulumi/pulumi-kubernetes/actions) [](https://slack.pulumi.com) [ || (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.ConfigGroup = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../../utilities"));
/**
* ConfigGroup creates a set of Kubernetes resources from Kubernetes YAML text. The YAML text
* may be supplied using any of the following methods:
*
* 1. Using a filename or a list of filenames:
* 2. Using a file pattern or a list of file patterns:
* 3. Using a literal string containing YAML, or a list of such strings:
* 4. Any combination of files, patterns, or YAML strings:
*
* ## 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 ConfigGroup. 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 ConfigGroup 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 ConfigGroups
* The `dependsOn` resource option creates a list of explicit dependencies between Pulumi resources.
* Use it on another resource to make it dependent on the ConfigGroup and to wait for the resources within
* the group to be deployed.
*
* A best practice is to deploy each application using its own ConfigGroup, especially when that application
* installs custom resource definitions.
*
* ## Example Usage
* ### Local File(s)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as k8s from "@pulumi/kubernetes";
*
* const example = new k8s.yaml.v2.ConfigGroup("example", {
* files: ["./manifest.yaml"],
* });
* ```
* ### Local File Pattern
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as k8s from "@pulumi/kubernetes";
*
* const example = new k8s.yaml.v2.ConfigGroup("example", {
* files: ["./manifests/*.yaml"],
* });
* ```
* {{% /example %}}
* ### Literal YAML String
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as k8s from "@pulumi/kubernetes";
*
* const example = new k8s.yaml.v2.ConfigGroup("example", {
* yaml: `
* apiVersion: v1
* kind: ConfigMap
* metadata:
* name: my-map
* `
* });
* ```
* ### Literal Object
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as k8s from "@pulumi/kubernetes";
*
* const example = new k8s.yaml.v2.ConfigGroup("example", {
* objs: [
* {
* apiVersion: "v1",
* kind: "ConfigMap",
* metadata: {
* name: "my-map"
* }
* }
* ]
* });
* ```
* {% /examples %}}
*/
class ConfigGroup extends pulumi.ComponentResource {
/** @internal */
static __pulumiType = 'kubernetes:yaml/v2:ConfigGroup';
/**
* Returns true if the given object is an instance of ConfigGroup. 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'] === ConfigGroup.__pulumiType;
}
/**
* Create a ConfigGroup 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) {
resourceInputs["files"] = args?.files;
resourceInputs["objs"] = args?.objs;
resourceInputs["resourcePrefix"] = args?.resourcePrefix;
resourceInputs["skipAwait"] = args?.skipAwait;
resourceInputs["yaml"] = args?.yaml;
resourceInputs["resources"] = undefined /*out*/;
}
else {
resourceInputs["resources"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ConfigGroup.__pulumiType, name, resourceInputs, opts, true /*remote*/);
}
}
exports.ConfigGroup = ConfigGroup;
//# sourceMappingURL=configGroup.js.map