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

com.pulumi.gitlab.kotlin.InstanceServiceAccount.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.gitlab.kotlin

import com.pulumi.core.Output
import com.pulumi.gitlab.kotlin.outputs.InstanceServiceAccountTimeouts
import com.pulumi.gitlab.kotlin.outputs.InstanceServiceAccountTimeouts.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

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

    public var args: InstanceServiceAccountArgs = InstanceServiceAccountArgs()

    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 InstanceServiceAccountArgsBuilder.() -> Unit) {
        val builder = InstanceServiceAccountArgsBuilder()
        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(): InstanceServiceAccount {
        val builtJavaResource = com.pulumi.gitlab.InstanceServiceAccount(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return InstanceServiceAccount(builtJavaResource)
    }
}

/**
 * The `gitlab.InstanceServiceAccount` resource allows creating a GitLab instance service account.
 * > In order for a user to create a user account, they must have admin privileges at the instance level. This makes this feature unavailable on `gitlab.com`
 * **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/user_service_accounts.html)
 */
public class InstanceServiceAccount internal constructor(
    override val javaResource: com.pulumi.gitlab.InstanceServiceAccount,
) : KotlinCustomResource(javaResource, InstanceServiceAccountMapper) {
    /**
     * The name of the user. If not specified, the default Service account user name is used.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The service account id.
     */
    public val serviceAccountId: Output
        get() = javaResource.serviceAccountId().applyValue({ args0 -> args0 })

    public val timeouts: Output?
        get() = javaResource.timeouts().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The username of the user. If not specified, it’s automatically generated.
     */
    public val username: Output?
        get() = javaResource.username().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

public object InstanceServiceAccountMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gitlab.InstanceServiceAccount::class == javaResource::class

    override fun map(javaResource: Resource): InstanceServiceAccount =
        InstanceServiceAccount(javaResource as com.pulumi.gitlab.InstanceServiceAccount)
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy