com.pulumi.kubernetes.kustomize.v2.kotlin.Directory.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-kubernetes-kotlin Show documentation
Show all versions of pulumi-kubernetes-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.kubernetes.kustomize.v2.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinComponentResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.ComponentResourceOptions
import com.pulumi.kotlin.options.ComponentResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [Directory].
*/
@PulumiTagMarker
public class DirectoryResourceBuilder internal constructor() {
public var name: String? = null
public var args: DirectoryArgs = DirectoryArgs()
public var opts: ComponentResourceOptions = ComponentResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend DirectoryArgsBuilder.() -> Unit) {
val builder = DirectoryArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend ComponentResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.ComponentResourceOptions.opts(block)
}
internal fun build(): Directory {
val builtJavaResource = com.pulumi.kubernetes.kustomize.v2.Directory(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Directory(builtJavaResource)
}
}
/**
* Directory is a component representing a collection of resources described by a kustomize directory (kustomization).
* ## Example Usage
* ### Local Kustomize Directory
* ```java
* package myproject;
* import com.pulumi.Pulumi;
* import com.pulumi.kubernetes.kustomize.v2.Directory;
* import com.pulumi.kubernetes.kustomize.v2.DirectoryArgs;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(ctx -> {
* var helloWorld = new Directory("helloWorldLocal", DirectoryArgs.builder()
* .directory("./helloWorld")
* .build());
* });
* }
* }
* ```
* ### Kustomize Directory from a Git Repo
* ```java
* package myproject;
* import com.pulumi.Pulumi;
* import com.pulumi.kubernetes.kustomize.v2.Directory;
* import com.pulumi.kubernetes.kustomize.v2.DirectoryArgs;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(ctx -> {
* var helloWorld = new Directory("helloWorldRemote", DirectoryArgs.builder()
* .directory("https://github.com/kubernetes-sigs/kustomize/tree/v3.3.1/examples/helloWorld")
* .build());
* });
* }
* }
* ```
*/
public class Directory internal constructor(
override val javaResource: com.pulumi.kubernetes.kustomize.v2.Directory,
) : KotlinComponentResource(javaResource, DirectoryMapper) {
/**
* Resources created by the Directory resource.
*/
public val resources: Output?
get() = javaResource.resources().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object DirectoryMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.kubernetes.kustomize.v2.Directory::class == javaResource::class
override fun map(javaResource: Resource): Directory = Directory(
javaResource as
com.pulumi.kubernetes.kustomize.v2.Directory,
)
}
/**
* @see [Directory].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Directory].
*/
public suspend fun directory(name: String, block: suspend DirectoryResourceBuilder.() -> Unit): Directory {
val builder = DirectoryResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Directory].
* @param name The _unique_ name of the resulting resource.
*/
public fun directory(name: String): Directory {
val builder = DirectoryResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy