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

com.pulumi.vault.ad.kotlin.SecretRoleArgs.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.ad.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.ad.SecretRoleArgs.builder
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const config = new vault.ad.SecretBackend("config", {
 *     backend: "ad",
 *     binddn: "CN=Administrator,CN=Users,DC=corp,DC=example,DC=net",
 *     bindpass: "SuperSecretPassw0rd",
 *     url: "ldaps://ad",
 *     insecureTls: true,
 *     userdn: "CN=Users,DC=corp,DC=example,DC=net",
 * });
 * const role = new vault.ad.SecretRole("role", {
 *     backend: config.backend,
 *     role: "bob",
 *     serviceAccountName: "Bob",
 *     ttl: 60,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * config = vault.ad.SecretBackend("config",
 *     backend="ad",
 *     binddn="CN=Administrator,CN=Users,DC=corp,DC=example,DC=net",
 *     bindpass="SuperSecretPassw0rd",
 *     url="ldaps://ad",
 *     insecure_tls=True,
 *     userdn="CN=Users,DC=corp,DC=example,DC=net")
 * role = vault.ad.SecretRole("role",
 *     backend=config.backend,
 *     role="bob",
 *     service_account_name="Bob",
 *     ttl=60)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var config = new Vault.AD.SecretBackend("config", new()
 *     {
 *         Backend = "ad",
 *         Binddn = "CN=Administrator,CN=Users,DC=corp,DC=example,DC=net",
 *         Bindpass = "SuperSecretPassw0rd",
 *         Url = "ldaps://ad",
 *         InsecureTls = true,
 *         Userdn = "CN=Users,DC=corp,DC=example,DC=net",
 *     });
 *     var role = new Vault.AD.SecretRole("role", new()
 *     {
 *         Backend = config.Backend,
 *         Role = "bob",
 *         ServiceAccountName = "Bob",
 *         Ttl = 60,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/ad"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		config, err := ad.NewSecretBackend(ctx, "config", &ad.SecretBackendArgs{
 * 			Backend:     pulumi.String("ad"),
 * 			Binddn:      pulumi.String("CN=Administrator,CN=Users,DC=corp,DC=example,DC=net"),
 * 			Bindpass:    pulumi.String("SuperSecretPassw0rd"),
 * 			Url:         pulumi.String("ldaps://ad"),
 * 			InsecureTls: pulumi.Bool(true),
 * 			Userdn:      pulumi.String("CN=Users,DC=corp,DC=example,DC=net"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = ad.NewSecretRole(ctx, "role", &ad.SecretRoleArgs{
 * 			Backend:            config.Backend,
 * 			Role:               pulumi.String("bob"),
 * 			ServiceAccountName: pulumi.String("Bob"),
 * 			Ttl:                pulumi.Int(60),
 * 		})
 * 		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.ad.SecretBackend;
 * import com.pulumi.vault.ad.SecretBackendArgs;
 * import com.pulumi.vault.ad.SecretRole;
 * import com.pulumi.vault.ad.SecretRoleArgs;
 * 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 config = new SecretBackend("config", SecretBackendArgs.builder()
 *             .backend("ad")
 *             .binddn("CN=Administrator,CN=Users,DC=corp,DC=example,DC=net")
 *             .bindpass("SuperSecretPassw0rd")
 *             .url("ldaps://ad")
 *             .insecureTls("true")
 *             .userdn("CN=Users,DC=corp,DC=example,DC=net")
 *             .build());
 *         var role = new SecretRole("role", SecretRoleArgs.builder()
 *             .backend(config.backend())
 *             .role("bob")
 *             .serviceAccountName("Bob")
 *             .ttl(60)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   config:
 *     type: vault:ad:SecretBackend
 *     properties:
 *       backend: ad
 *       binddn: CN=Administrator,CN=Users,DC=corp,DC=example,DC=net
 *       bindpass: SuperSecretPassw0rd
 *       url: ldaps://ad
 *       insecureTls: 'true'
 *       userdn: CN=Users,DC=corp,DC=example,DC=net
 *   role:
 *     type: vault:ad:SecretRole
 *     properties:
 *       backend: ${config.backend}
 *       role: bob
 *       serviceAccountName: Bob
 *       ttl: 60
 * ```
 * 
 * ## Import
 * AD secret backend roles can be imported using the `path`, e.g.
 * ```sh
 * $ pulumi import vault:ad/secretRole:SecretRole role ad/roles/bob
 * ```
 * @property backend The path the AD secret backend is mounted at,
 * with no leading or trailing `/`s.
 * @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 role The name to identify this role within the backend.
 * Must be unique within the backend.
 * @property serviceAccountName Specifies the name of the Active Directory service
 * account mapped to this role.
 * @property ttl The password time-to-live in seconds. Defaults to the configuration
 * ttl if not provided.
 */
public data class SecretRoleArgs(
    public val backend: Output? = null,
    public val namespace: Output? = null,
    public val role: Output? = null,
    public val serviceAccountName: Output? = null,
    public val ttl: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.vault.ad.SecretRoleArgs =
        com.pulumi.vault.ad.SecretRoleArgs.builder()
            .backend(backend?.applyValue({ args0 -> args0 }))
            .namespace(namespace?.applyValue({ args0 -> args0 }))
            .role(role?.applyValue({ args0 -> args0 }))
            .serviceAccountName(serviceAccountName?.applyValue({ args0 -> args0 }))
            .ttl(ttl?.applyValue({ args0 -> args0 })).build()
}

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

    private var namespace: Output? = null

    private var role: Output? = null

    private var serviceAccountName: Output? = null

    private var ttl: Output? = null

    /**
     * @param value The path the AD secret backend is mounted at,
     * with no leading or trailing `/`s.
     */
    @JvmName("eftjylsxbnkvgxxo")
    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("xecihuwfqjhrocri")
    public suspend fun namespace(`value`: Output) {
        this.namespace = value
    }

    /**
     * @param value The name to identify this role within the backend.
     * Must be unique within the backend.
     */
    @JvmName("ftfxwiospnjehuqr")
    public suspend fun role(`value`: Output) {
        this.role = value
    }

    /**
     * @param value Specifies the name of the Active Directory service
     * account mapped to this role.
     */
    @JvmName("nygjatlkelmnrriy")
    public suspend fun serviceAccountName(`value`: Output) {
        this.serviceAccountName = value
    }

    /**
     * @param value The password time-to-live in seconds. Defaults to the configuration
     * ttl if not provided.
     */
    @JvmName("lxddskssjfnnevfg")
    public suspend fun ttl(`value`: Output) {
        this.ttl = value
    }

    /**
     * @param value The path the AD secret backend is mounted at,
     * with no leading or trailing `/`s.
     */
    @JvmName("cyvigptkcivhkfpc")
    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("aabqmtuhsvfdxfjl")
    public suspend fun namespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namespace = mapped
    }

    /**
     * @param value The name to identify this role within the backend.
     * Must be unique within the backend.
     */
    @JvmName("fapklvwvdvuurmwd")
    public suspend fun role(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.role = mapped
    }

    /**
     * @param value Specifies the name of the Active Directory service
     * account mapped to this role.
     */
    @JvmName("camagnwctcwcjewu")
    public suspend fun serviceAccountName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceAccountName = mapped
    }

    /**
     * @param value The password time-to-live in seconds. Defaults to the configuration
     * ttl if not provided.
     */
    @JvmName("bjmoepeixhtcomjj")
    public suspend fun ttl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ttl = mapped
    }

    internal fun build(): SecretRoleArgs = SecretRoleArgs(
        backend = backend,
        namespace = namespace,
        role = role,
        serviceAccountName = serviceAccountName,
        ttl = ttl,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy