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

com.pulumi.vault.github.kotlin.TeamArgs.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: 6.4.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.vault.github.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.vault.github.TeamArgs.builder
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages policy mappings for Github Teams authenticated via Github. See the [Vault
 * documentation](https://www.vaultproject.io/docs/auth/github/) for more
 * information.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const example = new vault.github.AuthBackend("example", {organization: "myorg"});
 * const tfDevs = new vault.github.Team("tf_devs", {
 *     backend: example.id,
 *     team: "terraform-developers",
 *     policies: [
 *         "developer",
 *         "read-only",
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * example = vault.github.AuthBackend("example", organization="myorg")
 * tf_devs = vault.github.Team("tf_devs",
 *     backend=example.id,
 *     team="terraform-developers",
 *     policies=[
 *         "developer",
 *         "read-only",
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Vault.GitHub.AuthBackend("example", new()
 *     {
 *         Organization = "myorg",
 *     });
 *     var tfDevs = new Vault.GitHub.Team("tf_devs", new()
 *     {
 *         Backend = example.Id,
 *         TeamCity = "terraform-developers",
 *         Policies = new[]
 *         {
 *             "developer",
 *             "read-only",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/github"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := github.NewAuthBackend(ctx, "example", &github.AuthBackendArgs{
 * 			Organization: pulumi.String("myorg"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = github.NewTeam(ctx, "tf_devs", &github.TeamArgs{
 * 			Backend: example.ID(),
 * 			Team:    pulumi.String("terraform-developers"),
 * 			Policies: pulumi.StringArray{
 * 				pulumi.String("developer"),
 * 				pulumi.String("read-only"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.vault.github.AuthBackend;
 * import com.pulumi.vault.github.AuthBackendArgs;
 * import com.pulumi.vault.github.Team;
 * import com.pulumi.vault.github.TeamArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new AuthBackend("example", AuthBackendArgs.builder()
 *             .organization("myorg")
 *             .build());
 *         var tfDevs = new Team("tfDevs", TeamArgs.builder()
 *             .backend(example.id())
 *             .team("terraform-developers")
 *             .policies(
 *                 "developer",
 *                 "read-only")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: vault:github:AuthBackend
 *     properties:
 *       organization: myorg
 *   tfDevs:
 *     type: vault:github:Team
 *     name: tf_devs
 *     properties:
 *       backend: ${example.id}
 *       team: terraform-developers
 *       policies:
 *         - developer
 *         - read-only
 * ```
 * 
 * ## Import
 * Github team mappings can be imported using the `path`, e.g.
 * ```sh
 * $ pulumi import vault:github/team:Team tf_devs auth/github/map/teams/terraform-developers
 * ```
 * @property backend Path where the github auth backend is mounted. Defaults to `github`
 * if not specified.
 * @property namespace The namespace to provision the resource in.
 * The value should not contain leading or trailing forward slashes.
 * The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
 * *Available only for Vault Enterprise*.
 * @property policies An array of strings specifying the policies to be set on tokens
 * issued using this role.
 * @property team GitHub team name in "slugified" format.
 */
public data class TeamArgs(
    public val backend: Output? = null,
    public val namespace: Output? = null,
    public val policies: Output>? = null,
    public val team: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.vault.github.TeamArgs =
        com.pulumi.vault.github.TeamArgs.builder()
            .backend(backend?.applyValue({ args0 -> args0 }))
            .namespace(namespace?.applyValue({ args0 -> args0 }))
            .policies(policies?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .team(team?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [TeamArgs].
 */
@PulumiTagMarker
public class TeamArgsBuilder internal constructor() {
    private var backend: Output? = null

    private var namespace: Output? = null

    private var policies: Output>? = null

    private var team: Output? = null

    /**
     * @param value Path where the github auth backend is mounted. Defaults to `github`
     * if not specified.
     */
    @JvmName("wiicjirrpvexhnls")
    public suspend fun backend(`value`: Output) {
        this.backend = value
    }

    /**
     * @param value The namespace to provision the resource in.
     * The value should not contain leading or trailing forward slashes.
     * The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
     * *Available only for Vault Enterprise*.
     */
    @JvmName("uouuksduquswcvra")
    public suspend fun namespace(`value`: Output) {
        this.namespace = value
    }

    /**
     * @param value An array of strings specifying the policies to be set on tokens
     * issued using this role.
     */
    @JvmName("godphonjaiimtwpt")
    public suspend fun policies(`value`: Output>) {
        this.policies = value
    }

    @JvmName("nvcrfugqowpduthi")
    public suspend fun policies(vararg values: Output) {
        this.policies = Output.all(values.asList())
    }

    /**
     * @param values An array of strings specifying the policies to be set on tokens
     * issued using this role.
     */
    @JvmName("yseigqeaecxvmokv")
    public suspend fun policies(values: List>) {
        this.policies = Output.all(values)
    }

    /**
     * @param value GitHub team name in "slugified" format.
     */
    @JvmName("arqkcpmfuqpuarmr")
    public suspend fun team(`value`: Output) {
        this.team = value
    }

    /**
     * @param value Path where the github auth backend is mounted. Defaults to `github`
     * if not specified.
     */
    @JvmName("wgycdcyxeujyjytm")
    public suspend fun backend(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backend = mapped
    }

    /**
     * @param value The namespace to provision the resource in.
     * The value should not contain leading or trailing forward slashes.
     * The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
     * *Available only for Vault Enterprise*.
     */
    @JvmName("ojifeivhvefdhkgg")
    public suspend fun namespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namespace = mapped
    }

    /**
     * @param value An array of strings specifying the policies to be set on tokens
     * issued using this role.
     */
    @JvmName("kdqwoowustgwhatr")
    public suspend fun policies(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.policies = mapped
    }

    /**
     * @param values An array of strings specifying the policies to be set on tokens
     * issued using this role.
     */
    @JvmName("dganwukptghsoppj")
    public suspend fun policies(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.policies = mapped
    }

    /**
     * @param value GitHub team name in "slugified" format.
     */
    @JvmName("ulqwcjlskprnnkjj")
    public suspend fun team(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.team = mapped
    }

    internal fun build(): TeamArgs = TeamArgs(
        backend = backend,
        namespace = namespace,
        policies = policies,
        team = team,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy