Skip to content

Commit

Permalink
Merge pull request #40 from Ouest-France/fixDoc
Browse files Browse the repository at this point in the history
Fix docs
  • Loading branch information
pablo-ruth authored Mar 2, 2022
2 parents 1c491e7 + c3c4816 commit 61d79fd
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 109 deletions.
33 changes: 10 additions & 23 deletions docs/data-sources/group.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ldap_group Data Source - terraform-provider-ldap"
subcategory: ""
description: |-
ldap_group is a data source for managing an LDAP group.
---

# ldap_group (Data Source)
# ldap_group

`ldap_group` is a data source for managing an LDAP group.

## Example Usage

```terraform
```hcl
data "ldap_group" "group" {
ou = "OU=MyOU,DC=domain,DC=tld"
name = "MyGroup"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- **name** (String) LDAP group name.
- **ou** (String) OU where LDAP group will be search.

### Read-Only
## Argument Reference

- **description** (String) Description attribute for the LDAP
- **group_type** (String) Type of the group
- **id** (String) The DN of the LDAP group.
- **members** (Set of String) LDAP group members.
* `name` - (Required) LDAP group name.
* `ou` - (Required) OU where LDAP group will be search.

## Attribute Reference

* `description` - Description attribute for the LDAP
* `group_type` - Type of the group
* `id` - The DN of the LDAP group.
* `members` - LDAP group members.
36 changes: 10 additions & 26 deletions docs/data-sources/user.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ldap_user Data Source - terraform-provider-ldap"
subcategory: ""
description: |-
ldap_user is a data source for retrieving an LDAP user.
---

# ldap_user (Data Source)
# ldap_user

`ldap_user` is a data source for retrieving an LDAP user.

## Example Usage

```terraform
```hcl
data "ldap_user" "user" {
ou = "OU=MyOU,DC=domain,DC=tld"
name = "MyUser"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- **ou** (String) OU where LDAP user will be search.

### Optional

- **description** (String) Description attribute for the LDAP user.
- **name** (String) The name of the LDAP user.
- **sam_account_name** (String) The sAMAccountName of the LDAP user.
- **user_principal_name** (String) The userPrincipalName of the LDAP user

### Read-Only
## Argument Reference

- **id** (String) The DN of the LDAP user.
* `ou` - (Required) OU where LDAP user will be search.
* `name` - (Required) Name of the LDAP user.
* `sam_account_name` - (Optional) sAMAccountName of the LDAP user.
* `user_principal_name` - (Optional) UPN of the LDAP user.

## Attribute Reference

* `id` - The DN of the LDAP user.
* `description` - Description attribute for the LDAP user.
44 changes: 11 additions & 33 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
---
layout: ""
page_title: "LDAP Provider"
description: |-
The LDAP provider is used to interact with any ActiveDirectory server.
---

# LDAP Provider

The LDAP provider is used to interact with any ActiveDirectory server.

## Example Usage

```terraform
```hcl
# Provider configuration
terraform {
required_providers {
Expand All @@ -27,37 +20,22 @@ provider "ldap" {
bind_user = "ldap_user"
bind_password = "ldap_password"
}
...
```

<!-- schema generated by tfplugindocs -->
## Argument Reference

## Environment variables
* `host` - (Required) LDAP host, can also be provided with env var **LDAP_HOST**.

You can provide your credentials via the LDAP_USER, LDAP_PASSWORD, LDAP_HOST and LDAP_PORT environment variables.
In this case, ldap provider could be represented like this
```
provider "ldap" {}
```
Usage
```
$ export LDAP_USER="ldap_user"
$ export LDAP_PASSWORD="ldap_password"
$ export LDAP_HOST="ldap.mycompany.tld"
$ export LDAP_PORT=389
$ terraform plan
```
* `port` - (Required) LDAP port, can also be provided with env var **LDAP_PORT**.

## Schema
* `bind_user` - (Required) LDAP username, can also be provided with env var **LDAP_USER**.

### Required
* `bind_password` - (Required) LDAP password, can also be provided with env var **LDAP_PASSWORD**.

- **bind_password** (String) LDAP password
- **bind_user** (String) LDAP username
- **host** (String) LDAP host
- **port** (Number) LDAP port
* `tls` - (Optional) Enable the TLS encryption for LDAP (LDAPS). Default, is `false`.

### Optional
* `tls_ca_certificate` - (Optional) The TLS CA certificate to trust for the LDAPS connection. Default is empty.

- **tls** (Boolean) Enable the TLS encryption for LDAP (LDAPS). Default, is `false`.
- **tls_ca_certificate** (String) The TLS CA certificate to trust for the LDAPS connection.
- **tls_insecure** (Boolean) Don't verify the server TLS certificate. Default is `false`.
* `tls_insecure` - (Optional) Don't verify the server TLS certificate. Default is `false`.
38 changes: 15 additions & 23 deletions docs/resources/group.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ldap_group Resource - terraform-provider-ldap"
subcategory: ""
description: |-
ldap_group is a resource for managing an LDAP group.
---

# ldap_group (Resource)
# ldap_group

`ldap_group` is a resource for managing an LDAP group.

## Example Usage

```terraform
```hcl
resource "ldap_group" "group" {
ou = "OU=MyOU,DC=domain,DC=tld"
name = "MyGroup"
Expand All @@ -21,22 +13,22 @@ resource "ldap_group" "group" {
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required
## Argument Reference

- **name** (String) LDAP group name.
- **ou** (String) OU where LDAP group will be created.
* `ou` - (Required) OU where LDAP group will be created.
* `name` - (Required) LDAP group name.
* `members` - (Optional) LDAP group members. Defaults to `[]`.
* `description` - (Optional) Description attribute for the LDAP group. Defaults to empty.

### Optional
## Attribute Reference

- **description** (String) Description attribute for the LDAP group.
- **group_type** (String) Type of the group
- **members** (Set of String) LDAP group members.
* `id` - The DN of the LDAP group.
* `group_type` - Type of the group.

### Read-Only

- **id** (String) The DN of the LDAP group.
## Import

LDAP group can be imported using the full LDAP DN (id), e.g.

```
$ terraform import ldap_group.example CN=MyGroup,OU=MyOU,DC=domain,DC=tld
```
7 changes: 3 additions & 4 deletions ldap/data_source_resource_ldap_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ func dataSourceLDAPUser() *schema.Resource {
Required: true,
},
"name": {
Description: "The name of the LDAP user.",
Type: schema.TypeString,
Optional: true,
ExactlyOneOf: []string{"name", "sam_account_name", "user_principal_name"},
Description: "The name of the LDAP user.",
Type: schema.TypeString,
Required: true,
},
"sam_account_name": {
Description: "The sAMAccountName of the LDAP user.",
Expand Down

0 comments on commit 61d79fd

Please sign in to comment.