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

com.pulumi.googlenative.cloudbuild.v1alpha1.kotlin.WorkerPool.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.cloudbuild.v1alpha1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.cloudbuild.v1alpha1.kotlin.outputs.WorkerConfigResponse
import com.pulumi.googlenative.cloudbuild.v1alpha1.kotlin.outputs.WorkerConfigResponse.Companion.toKotlin
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [WorkerPool].
 */
@PulumiTagMarker
public class WorkerPoolResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: WorkerPoolArgs = WorkerPoolArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @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 WorkerPoolArgsBuilder.() -> Unit) {
        val builder = WorkerPoolArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): WorkerPool {
        val builtJavaResource =
            com.pulumi.googlenative.cloudbuild.v1alpha1.WorkerPool(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return WorkerPool(builtJavaResource)
    }
}

/**
 * Creates a `WorkerPool` to run the builds, and returns the new worker pool.
 */
public class WorkerPool internal constructor(
    override val javaResource: com.pulumi.googlenative.cloudbuild.v1alpha1.WorkerPool,
) : KotlinCustomResource(javaResource, WorkerPoolMapper) {
    /**
     * Time at which the request to create the `WorkerPool` was received.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Time at which the request to delete the `WorkerPool` was received.
     */
    public val deleteTime: Output
        get() = javaResource.deleteTime().applyValue({ args0 -> args0 })

    /**
     * User-defined name of the `WorkerPool`.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * List of regions to create the `WorkerPool`. Regions can't be empty. If Cloud Build adds a new GCP region in the future, the existing `WorkerPool` will not be enabled in the new region automatically; you must add the new region to the `regions` field to enable the `WorkerPool` in that region.
     */
    public val regions: Output>
        get() = javaResource.regions().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The service account used to manage the `WorkerPool`. The service account must have the Compute Instance Admin (Beta) permission at the project level.
     */
    public val serviceAccountEmail: Output
        get() = javaResource.serviceAccountEmail().applyValue({ args0 -> args0 })

    /**
     * WorkerPool Status.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    /**
     * Time at which the request to update the `WorkerPool` was received.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })

    /**
     * Configuration to be used for a creating workers in the `WorkerPool`.
     */
    public val workerConfig: Output
        get() = javaResource.workerConfig().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })

    /**
     * Total number of workers to be created across all requested regions.
     */
    public val workerCount: Output
        get() = javaResource.workerCount().applyValue({ args0 -> args0 })
}

public object WorkerPoolMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.cloudbuild.v1alpha1.WorkerPool::class == javaResource::class

    override fun map(javaResource: Resource): WorkerPool = WorkerPool(
        javaResource as
            com.pulumi.googlenative.cloudbuild.v1alpha1.WorkerPool,
    )
}

/**
 * @see [WorkerPool].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [WorkerPool].
 */
public suspend fun workerPool(name: String, block: suspend WorkerPoolResourceBuilder.() -> Unit): WorkerPool {
    val builder = WorkerPoolResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [WorkerPool].
 * @param name The _unique_ name of the resulting resource.
 */
public fun workerPool(name: String): WorkerPool {
    val builder = WorkerPoolResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy