com.pulumi.vault.ldap.kotlin.AuthBackendUserArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-vault-kotlin Show documentation
Show all versions of pulumi-vault-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.vault.ldap.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.ldap.AuthBackendUserArgs.builder
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Provides a resource to create a user in an [LDAP auth backend within Vault](https://www.vaultproject.io/docs/auth/ldap.html).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const ldap = new vault.ldap.AuthBackend("ldap", {
* path: "ldap",
* url: "ldaps://dc-01.example.org",
* userdn: "OU=Users,OU=Accounts,DC=example,DC=org",
* userattr: "sAMAccountName",
* upndomain: "EXAMPLE.ORG",
* discoverdn: false,
* groupdn: "OU=Groups,DC=example,DC=org",
* groupfilter: "(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))",
* });
* const user = new vault.ldap.AuthBackendUser("user", {
* username: "test-user",
* policies: [
* "dba",
* "sysops",
* ],
* backend: ldap.path,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* ldap = vault.ldap.AuthBackend("ldap",
* path="ldap",
* url="ldaps://dc-01.example.org",
* userdn="OU=Users,OU=Accounts,DC=example,DC=org",
* userattr="sAMAccountName",
* upndomain="EXAMPLE.ORG",
* discoverdn=False,
* groupdn="OU=Groups,DC=example,DC=org",
* groupfilter="(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))")
* user = vault.ldap.AuthBackendUser("user",
* username="test-user",
* policies=[
* "dba",
* "sysops",
* ],
* backend=ldap.path)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var ldap = new Vault.Ldap.AuthBackend("ldap", new()
* {
* Path = "ldap",
* Url = "ldaps://dc-01.example.org",
* Userdn = "OU=Users,OU=Accounts,DC=example,DC=org",
* Userattr = "sAMAccountName",
* Upndomain = "EXAMPLE.ORG",
* Discoverdn = false,
* Groupdn = "OU=Groups,DC=example,DC=org",
* Groupfilter = "(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))",
* });
* var user = new Vault.Ldap.AuthBackendUser("user", new()
* {
* Username = "test-user",
* Policies = new[]
* {
* "dba",
* "sysops",
* },
* Backend = ldap.Path,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/ldap"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* ldap, err := ldap.NewAuthBackend(ctx, "ldap", &ldap.AuthBackendArgs{
* Path: pulumi.String("ldap"),
* Url: pulumi.String("ldaps://dc-01.example.org"),
* Userdn: pulumi.String("OU=Users,OU=Accounts,DC=example,DC=org"),
* Userattr: pulumi.String("sAMAccountName"),
* Upndomain: pulumi.String("EXAMPLE.ORG"),
* Discoverdn: pulumi.Bool(false),
* Groupdn: pulumi.String("OU=Groups,DC=example,DC=org"),
* Groupfilter: pulumi.String("(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))"),
* })
* if err != nil {
* return err
* }
* _, err = ldap.NewAuthBackendUser(ctx, "user", &ldap.AuthBackendUserArgs{
* Username: pulumi.String("test-user"),
* Policies: pulumi.StringArray{
* pulumi.String("dba"),
* pulumi.String("sysops"),
* },
* Backend: ldap.Path,
* })
* 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.ldap.AuthBackend;
* import com.pulumi.vault.ldap.AuthBackendArgs;
* import com.pulumi.vault.ldap.AuthBackendUser;
* import com.pulumi.vault.ldap.AuthBackendUserArgs;
* 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 ldap = new AuthBackend("ldap", AuthBackendArgs.builder()
* .path("ldap")
* .url("ldaps://dc-01.example.org")
* .userdn("OU=Users,OU=Accounts,DC=example,DC=org")
* .userattr("sAMAccountName")
* .upndomain("EXAMPLE.ORG")
* .discoverdn(false)
* .groupdn("OU=Groups,DC=example,DC=org")
* .groupfilter("(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))")
* .build());
* var user = new AuthBackendUser("user", AuthBackendUserArgs.builder()
* .username("test-user")
* .policies(
* "dba",
* "sysops")
* .backend(ldap.path())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* ldap:
* type: vault:ldap:AuthBackend
* properties:
* path: ldap
* url: ldaps://dc-01.example.org
* userdn: OU=Users,OU=Accounts,DC=example,DC=org
* userattr: sAMAccountName
* upndomain: EXAMPLE.ORG
* discoverdn: false
* groupdn: OU=Groups,DC=example,DC=org
* groupfilter: (&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))
* user:
* type: vault:ldap:AuthBackendUser
* properties:
* username: test-user
* policies:
* - dba
* - sysops
* backend: ${ldap.path}
* ```
*
* ## Import
* LDAP authentication backend users can be imported using the `path`, e.g.
* ```sh
* $ pulumi import vault:ldap/authBackendUser:AuthBackendUser foo auth/ldap/users/foo
* ```
* @property backend Path to the authentication backend
* For more details on the usage of each argument consult the [Vault LDAP API documentation](https://www.vaultproject.io/api-docs/auth/ldap).
* @property groups Override LDAP groups which should be granted to user
* @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 Policies which should be granted to user
* @property username The LDAP username
*/
public data class AuthBackendUserArgs(
public val backend: Output? = null,
public val groups: Output>? = null,
public val namespace: Output? = null,
public val policies: Output>? = null,
public val username: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.vault.ldap.AuthBackendUserArgs =
com.pulumi.vault.ldap.AuthBackendUserArgs.builder()
.backend(backend?.applyValue({ args0 -> args0 }))
.groups(groups?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.namespace(namespace?.applyValue({ args0 -> args0 }))
.policies(policies?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.username(username?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [AuthBackendUserArgs].
*/
@PulumiTagMarker
public class AuthBackendUserArgsBuilder internal constructor() {
private var backend: Output? = null
private var groups: Output>? = null
private var namespace: Output? = null
private var policies: Output>? = null
private var username: Output? = null
/**
* @param value Path to the authentication backend
* For more details on the usage of each argument consult the [Vault LDAP API documentation](https://www.vaultproject.io/api-docs/auth/ldap).
*/
@JvmName("povbrefitwfqfuhy")
public suspend fun backend(`value`: Output) {
this.backend = value
}
/**
* @param value Override LDAP groups which should be granted to user
*/
@JvmName("usoluoyuadeatywq")
public suspend fun groups(`value`: Output>) {
this.groups = value
}
@JvmName("tdjqwlavhcuxxepl")
public suspend fun groups(vararg values: Output) {
this.groups = Output.all(values.asList())
}
/**
* @param values Override LDAP groups which should be granted to user
*/
@JvmName("gaceqvfgetsquxih")
public suspend fun groups(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy