Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 1, 2021
1 parent 3ada8c1 commit 6f258d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 43 deletions.
21 changes: 3 additions & 18 deletions ldap-ou-create/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,8 @@ The [ldap-provider](https://github.e.it.census.gov/terraform/support/tree/master
This has to be done before creating any roles with `aws-iam-role` and LDAP creation enabled.

There are some quirks to the `ldap-provider` (we use [this](https://github.com/Pryz/terraform-provider-ldap) one), where if any
details change in the DN or the DN cannot be constructed due to missing data, a *tcp connection closed* message occurs.

Because of this quirk, this is a two-step apply. The first step creates the IAM role and creates an LDIF file in
`setup/{role-name}.ldif`. It uses the presence of this file to create the LDAP object in the second step. Example:

1. Step 1, creates null resource
```console
% terraform apply -target=module.ou
```

2. Step 2, creates ldap object
```console
% terraform apply -target=module.ou
```
details change in the DN or the DN cannot be constructed due to missing data, a *tcp connection closed* message occurs. However, for this
one, there are no changes to the resource which are dynamic, so it can be done normally in just one step.

# Usage

Expand Down Expand Up @@ -85,7 +73,4 @@ No modules.

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_role_arn"></a> [role\_arn](#output\_role\_arn) | Created role ARN |
| <a name="output_role_name"></a> [role\_name](#output\_role\_name) | Created role name |
No outputs.
19 changes: 4 additions & 15 deletions ldap-ou-create/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,8 @@
* This has to be done before creating any roles with `aws-iam-role` and LDAP creation enabled.
*
* There are some quirks to the `ldap-provider` (we use [this](https://github.com/Pryz/terraform-provider-ldap) one), where if any
* details change in the DN or the DN cannot be constructed due to missing data, a *tcp connection closed* message occurs.
*
* Because of this quirk, this is a two-step apply. The first step creates the IAM role and creates an LDIF file in
* `setup/{role-name}.ldif`. It uses the presence of this file to create the LDAP object in the second step. Example:
*
* 1. Step 1, creates null resource
* ```console
* % terraform apply -target=module.ou
* ```
*
* 2. Step 2, creates ldap object
* ```console
* % terraform apply -target=module.ou
* ```
* details change in the DN or the DN cannot be constructed due to missing data, a *tcp connection closed* message occurs. However, for this
* one, there are no changes to the resource which are dynamic, so it can be done normally in just one step.
*
* # Usage
*
Expand Down Expand Up @@ -79,7 +67,8 @@ resource "null_resource" "ou_ldif" {
}

resource "ldap_object" "ou" {
count = local.ldap_exists && local.enable_ldap ? 1 : 0
# count = local.ldap_exists && local.enable_ldap ? 1 : 0
count = local.enable_ldap ? 1 : 0
provider = ldap
dn = format("ou=%s,ou=AWS,ou=Cloud,ou=Application,o=U.S. Census Bureau,c=US", local.account_id)
object_classes = [
Expand Down
10 changes: 0 additions & 10 deletions ldap-ou-create/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@

output "role_arn" {
description = "Created role ARN"
value = aws_iam_role.role.arn
}

output "role_name" {
description = "Created role name"
value = aws_iam_role.role.name
}

0 comments on commit 6f258d6

Please sign in to comment.