Skip to content

Commit

Permalink
Merge pull request #921 from wellsiau-aws/d-improve-organizational_unit
Browse files Browse the repository at this point in the history
docs - organizations_organization_unit
  • Loading branch information
ewbankkit authored Apr 27, 2023
2 parents d142d3f + 92a4e0f commit 75388ef
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/resources/accessanalyzer_analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ The AWS::AccessAnalyzer::Analyzer type specifies an analyzer of the user's accou
To use awscc_accessanalyzer_analyzer on single AWS account:

```terraform
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
resource "awscc_accessanalyzer_analyzer" "this" {
analyzer_name = "example"
type = ACCOUNT
Expand All @@ -27,6 +30,9 @@ resource "awscc_accessanalyzer_analyzer" "this" {
To enable awscc_accessanalyzer_analyzer at the organization level, modify example below to match your AWS organization configuration.

```terraform
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
resource "aws_organizations_organization" "this" {
aws_service_access_principals = ["access-analyzer.amazonaws.com"]
}
Expand Down
28 changes: 26 additions & 2 deletions docs/resources/organizations_organizational_unit.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_organizations_organizational_unit Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -10,7 +9,32 @@ description: |-

You can use organizational units (OUs) to group accounts together to administer as a single unit. This greatly simplifies the management of your accounts. For example, you can attach a policy-based control to an OU, and all accounts within the OU automatically inherit the policy. You can create multiple OUs within a single organization, and you can create OUs within other OUs. Each OU can contain multiple accounts, and you can move accounts from one OU to another. However, OU names must be unique within a parent OU or root.

## Example Usage

### OU under root
To create a new OU under the root Organizations:

```terraform
resource "awscc_organizations_organizational_unit" "this" {
name = "child-ou-lv1"
parent_id = var.root_id
}
```

### Nested OU
To create a nested OU

```terraform
resource "awscc_organizations_organizational_unit" "level_1_ou" {
name = "child-ou-lv1"
parent_id = var.root_id
}
resource "awscc_organizations_organizational_unit" "level_2_ou" {
name = "child-ou-lv2"
parent_id = awscc_organizations_organizational_unit.level_1_ou.id
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -43,4 +67,4 @@ Import is supported using the following syntax:

```shell
$ terraform import awscc_organizations_organizational_unit.example <resource ID>
```
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "awscc_organizations_organizational_unit" "level_1_ou" {
name = "child-ou-lv1"
parent_id = var.root_id
}

resource "awscc_organizations_organizational_unit" "level_2_ou" {
name = "child-ou-lv2"
parent_id = awscc_organizations_organizational_unit.level_1_ou.id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "awscc_organizations_organizational_unit" "this" {
name = "child-ou-lv1"
parent_id = var.root_id
}
33 changes: 33 additions & 0 deletions templates/resources/organizations_organizational_unit.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | trimspace }}

## Example Usage

### OU under root
To create a new OU under the root Organizations:

{{ tffile (printf "examples/resources/%s/simple_ou.tf" .Name)}}

### Nested OU
To create a nested OU

{{ tffile (printf "examples/resources/%s/nested_ou.tf" .Name)}}

{{ .SchemaMarkdown | trimspace }}
{{- if .HasImport }}

## Import

Import is supported using the following syntax:

{{ codefile "shell" .ImportFile }}

{{- end }}

0 comments on commit 75388ef

Please sign in to comment.