vault logo
HashiCorp Vault v5.10.0, Mar 21 23

vault.ldap.AuthBackendGroup

Provides a resource to create a group in an LDAP auth backend within Vault.

Example Usage

using System.Collections.Generic;
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 @group = new Vault.Ldap.AuthBackendGroup("group", new()
    {
        Groupname = "dba",
        Policies = new[]
        {
            "dba",
        },
        Backend = ldap.Path,
    });

});
package main

import (
	"github.com/pulumi/pulumi-vault/sdk/v5/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.NewAuthBackendGroup(ctx, "group", &ldap.AuthBackendGroupArgs{
			Groupname: pulumi.String("dba"),
			Policies: pulumi.StringArray{
				pulumi.String("dba"),
			},
			Backend: ldap.Path,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.AuthBackendGroup;
import com.pulumi.vault.ldap.AuthBackendGroupArgs;
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 group = new AuthBackendGroup("group", AuthBackendGroupArgs.builder()        
            .groupname("dba")
            .policies("dba")
            .backend(ldap.path())
            .build());

    }
}
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}}))")
group = vault.ldap.AuthBackendGroup("group",
    groupname="dba",
    policies=["dba"],
    backend=ldap.path)
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 group = new vault.ldap.AuthBackendGroup("group", {
    groupname: "dba",
    policies: ["dba"],
    backend: ldap.path,
});
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}}))
  group:
    type: vault:ldap:AuthBackendGroup
    properties:
      groupname: dba
      policies:
        - dba
      backend: ${ldap.path}

Create AuthBackendGroup Resource

new AuthBackendGroup(name: string, args: AuthBackendGroupArgs, opts?: CustomResourceOptions);
@overload
def AuthBackendGroup(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     backend: Optional[str] = None,
                     groupname: Optional[str] = None,
                     namespace: Optional[str] = None,
                     policies: Optional[Sequence[str]] = None)
@overload
def AuthBackendGroup(resource_name: str,
                     args: AuthBackendGroupArgs,
                     opts: Optional[ResourceOptions] = None)
func NewAuthBackendGroup(ctx *Context, name string, args AuthBackendGroupArgs, opts ...ResourceOption) (*AuthBackendGroup, error)
public AuthBackendGroup(string name, AuthBackendGroupArgs args, CustomResourceOptions? opts = null)
public AuthBackendGroup(String name, AuthBackendGroupArgs args)
public AuthBackendGroup(String name, AuthBackendGroupArgs args, CustomResourceOptions options)
type: vault:ldap:AuthBackendGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AuthBackendGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AuthBackendGroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AuthBackendGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AuthBackendGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AuthBackendGroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AuthBackendGroup Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AuthBackendGroup resource accepts the following input properties:

Groupname string

The LDAP groupname

Backend string

Path to the authentication backend

Namespace string

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. Available only for Vault Enterprise.

Policies List<string>

Policies which should be granted to members of the group

Groupname string

The LDAP groupname

Backend string

Path to the authentication backend

Namespace string

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. Available only for Vault Enterprise.

Policies []string

Policies which should be granted to members of the group

groupname String

The LDAP groupname

backend String

Path to the authentication backend

namespace String

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. Available only for Vault Enterprise.

policies List<String>

Policies which should be granted to members of the group

groupname string

The LDAP groupname

backend string

Path to the authentication backend

namespace string

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. Available only for Vault Enterprise.

policies string[]

Policies which should be granted to members of the group

groupname str

The LDAP groupname

backend str

Path to the authentication backend

namespace str

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. Available only for Vault Enterprise.

policies Sequence[str]

Policies which should be granted to members of the group

groupname String

The LDAP groupname

backend String

Path to the authentication backend

namespace String

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. Available only for Vault Enterprise.

policies List<String>

Policies which should be granted to members of the group

Outputs

All input properties are implicitly available as output properties. Additionally, the AuthBackendGroup resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing AuthBackendGroup Resource

Get an existing AuthBackendGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AuthBackendGroupState, opts?: CustomResourceOptions): AuthBackendGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backend: Optional[str] = None,
        groupname: Optional[str] = None,
        namespace: Optional[str] = None,
        policies: Optional[Sequence[str]] = None) -> AuthBackendGroup
func GetAuthBackendGroup(ctx *Context, name string, id IDInput, state *AuthBackendGroupState, opts ...ResourceOption) (*AuthBackendGroup, error)
public static AuthBackendGroup Get(string name, Input<string> id, AuthBackendGroupState? state, CustomResourceOptions? opts = null)
public static AuthBackendGroup get(String name, Output<String> id, AuthBackendGroupState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Backend string

Path to the authentication backend

Groupname string

The LDAP groupname

Namespace string

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. Available only for Vault Enterprise.

Policies List<string>

Policies which should be granted to members of the group

Backend string

Path to the authentication backend

Groupname string

The LDAP groupname

Namespace string

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. Available only for Vault Enterprise.

Policies []string

Policies which should be granted to members of the group

backend String

Path to the authentication backend

groupname String

The LDAP groupname

namespace String

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. Available only for Vault Enterprise.

policies List<String>

Policies which should be granted to members of the group

backend string

Path to the authentication backend

groupname string

The LDAP groupname

namespace string

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. Available only for Vault Enterprise.

policies string[]

Policies which should be granted to members of the group

backend str

Path to the authentication backend

groupname str

The LDAP groupname

namespace str

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. Available only for Vault Enterprise.

policies Sequence[str]

Policies which should be granted to members of the group

backend String

Path to the authentication backend

groupname String

The LDAP groupname

namespace String

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. Available only for Vault Enterprise.

policies List<String>

Policies which should be granted to members of the group

Import

LDAP authentication backend groups can be imported using the path, e.g.

 $ pulumi import vault:ldap/authBackendGroup:AuthBackendGroup foo auth/ldap/groups/foo

Package Details

Repository
Vault pulumi/pulumi-vault
License
Apache-2.0
Notes

This Pulumi package is based on the vault Terraform Provider.