All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.kubernetes.yaml.v2.kotlin.ConfigFileArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 4.18.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.kubernetes.yaml.v2.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kubernetes.yaml.v2.ConfigFileArgs.builder
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * 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 | `/namespaces///` |
 * | cluster-scoped   | `//`                        |
 * 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.
 * {{% examples %}}
 * ## Example Usage
 * {{% example %}}
 * ### Local File
 * ```yaml
 * name: example
 * runtime: yaml
 * resources:
 *   example:
 *     type: kubernetes:yaml/v2:ConfigFile
 *     properties:
 *       file: ./manifest.yaml
 * ```
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as k8s from "@pulumi/kubernetes";
 * const example = new k8s.yaml.v2.ConfigFile("example", {
 *     files: ["./manifest.yaml"],
 * });
 * ```
 * ```python
 * import pulumi
 * from pulumi_kubernetes.yaml.v2 import ConfigFile
 * example = ConfigFile(
 *     "example",
 *     file="./manifest.yaml"
 * )
 * ```
 * ```csharp
 * using Pulumi;
 * using Pulumi.Kubernetes.Types.Inputs.Yaml.V2;
 * using Pulumi.Kubernetes.Yaml.V2;
 * using System.Collections.Generic;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new ConfigFile("example", new ConfigFileArgs
 *     {
 *         File = "./manifest.yaml"
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	yamlv2 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := yamlv2.NewConfigFile(ctx, "example", &yamlv2.ConfigFileArgs{
 * 			File: pulumi.String("manifest.yaml"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package myproject;
 * import com.pulumi.Pulumi;
 * import com.pulumi.kubernetes.yaml.v2.ConfigFile;
 * import com.pulumi.kubernetes.yaml.v2.ConfigFileArgs;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(ctx -> {
 *             var example = new ConfigFile("example", ConfigFileArgs.builder()
 *                     .file("./manifest.yaml")
 *                     .build());
 *         });
 *     }
 * }
 * ```
 * {{% /example %}}
 * {% /examples %}}
 * @property file Path or URL to a Kubernetes manifest file. File must exist.
 * @property resourcePrefix A prefix for the auto-generated resource names. Defaults to the name of the ConfigFile. Example: A resource created with resourcePrefix="foo" would produce a resource named "foo-resourceName".
 * @property skipAwait Indicates that child resources should skip the await logic.
 */
public data class ConfigFileArgs(
    public val `file`: Output? = null,
    public val resourcePrefix: Output? = null,
    public val skipAwait: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.yaml.v2.ConfigFileArgs =
        com.pulumi.kubernetes.yaml.v2.ConfigFileArgs.builder()
            .`file`(`file`?.applyValue({ args0 -> args0 }))
            .resourcePrefix(resourcePrefix?.applyValue({ args0 -> args0 }))
            .skipAwait(skipAwait?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ConfigFileArgs].
 */
@PulumiTagMarker
public class ConfigFileArgsBuilder internal constructor() {
    private var `file`: Output? = null

    private var resourcePrefix: Output? = null

    private var skipAwait: Output? = null

    /**
     * @param value Path or URL to a Kubernetes manifest file. File must exist.
     */
    @JvmName("wuoqckrkwhnshvqv")
    public suspend fun `file`(`value`: Output) {
        this.`file` = value
    }

    /**
     * @param value A prefix for the auto-generated resource names. Defaults to the name of the ConfigFile. Example: A resource created with resourcePrefix="foo" would produce a resource named "foo-resourceName".
     */
    @JvmName("qluikrqfojrxesip")
    public suspend fun resourcePrefix(`value`: Output) {
        this.resourcePrefix = value
    }

    /**
     * @param value Indicates that child resources should skip the await logic.
     */
    @JvmName("pyylbpbrplscsslh")
    public suspend fun skipAwait(`value`: Output) {
        this.skipAwait = value
    }

    /**
     * @param value Path or URL to a Kubernetes manifest file. File must exist.
     */
    @JvmName("nvimnyjkatdlqkgr")
    public suspend fun `file`(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.`file` = mapped
    }

    /**
     * @param value A prefix for the auto-generated resource names. Defaults to the name of the ConfigFile. Example: A resource created with resourcePrefix="foo" would produce a resource named "foo-resourceName".
     */
    @JvmName("sumpuxwcqbynrnqd")
    public suspend fun resourcePrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourcePrefix = mapped
    }

    /**
     * @param value Indicates that child resources should skip the await logic.
     */
    @JvmName("gogtbvvtooovxvng")
    public suspend fun skipAwait(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.skipAwait = mapped
    }

    internal fun build(): ConfigFileArgs = ConfigFileArgs(
        `file` = `file`,
        resourcePrefix = resourcePrefix,
        skipAwait = skipAwait,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy