diff --git a/docs/resources/accessanalyzer_analyzer.md b/docs/resources/accessanalyzer_analyzer.md index 80bcee5251..6964968ab0 100644 --- a/docs/resources/accessanalyzer_analyzer.md +++ b/docs/resources/accessanalyzer_analyzer.md @@ -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 @@ -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"] } diff --git a/docs/resources/organizations_organizational_unit.md b/docs/resources/organizations_organizational_unit.md index 61ee77e1a8..a96bdbed98 100644 --- a/docs/resources/organizations_organizational_unit.md +++ b/docs/resources/organizations_organizational_unit.md @@ -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: |- @@ -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 @@ -43,4 +67,4 @@ Import is supported using the following syntax: ```shell $ terraform import awscc_organizations_organizational_unit.example -``` +``` \ No newline at end of file diff --git a/examples/resources/awscc_organizations_organizational_unit/nested_ou.tf b/examples/resources/awscc_organizations_organizational_unit/nested_ou.tf new file mode 100644 index 0000000000..998404fc77 --- /dev/null +++ b/examples/resources/awscc_organizations_organizational_unit/nested_ou.tf @@ -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 +} \ No newline at end of file diff --git a/examples/resources/awscc_organizations_organizational_unit/simple_ou.tf b/examples/resources/awscc_organizations_organizational_unit/simple_ou.tf new file mode 100644 index 0000000000..ab9fb98428 --- /dev/null +++ b/examples/resources/awscc_organizations_organizational_unit/simple_ou.tf @@ -0,0 +1,4 @@ +resource "awscc_organizations_organizational_unit" "this" { + name = "child-ou-lv1" + parent_id = var.root_id +} \ No newline at end of file diff --git a/templates/resources/organizations_organizational_unit.md.tmpl b/templates/resources/organizations_organizational_unit.md.tmpl new file mode 100644 index 0000000000..b9079fd4b0 --- /dev/null +++ b/templates/resources/organizations_organizational_unit.md.tmpl @@ -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 }} \ No newline at end of file