diff --git a/modules/aws/organizations/account/README.md b/modules/aws/organizations/account/README.md index 8a5cc5a4..82770228 100644 --- a/modules/aws/organizations/account/README.md +++ b/modules/aws/organizations/account/README.md @@ -1,7 +1,7 @@ - + + [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] @@ -18,7 +19,6 @@ [![MIT License][license-shield]][license-url] [![LinkedIn][linkedin-shield]][linkedin-url] -
@@ -41,7 +41,6 @@

-
Table of Contents @@ -59,14 +58,14 @@
- + ## Usage ``` module "account_prod_infrastructure" { - source = "github.com/zachreborn/terraform-modules//modules/aws/organizations_account" - + source = "github.com/zachreborn/terraform-modules//modules/aws/organizations/account" + name = "account_prod_infrastructure" email = "aws_environments+account@example.com" parent_id = var.account_parent_id @@ -125,15 +124,15 @@ No modules. + ## License Distributed under the MIT License. See `LICENSE.txt` for more information.

(back to top)

- - + ## Contact Zachary Hill - [![LinkedIn][linkedin-shield]][linkedin-url] - zhill@zacharyhill.co @@ -142,19 +141,18 @@ Project Link: [https://github.com/zachreborn/terraform-modules](https://github.c

(back to top)

- - + ## Acknowledgments -* [Zachary Hill](https://zacharyhill.co) -* [Jake Jones](https://github.com/jakeasarus) +- [Zachary Hill](https://zacharyhill.co) +- [Jake Jones](https://github.com/jakeasarus)

(back to top)

- + [contributors-shield]: https://img.shields.io/github/contributors/zachreborn/terraform-modules.svg?style=for-the-badge [contributors-url]: https://github.com/zachreborn/terraform-modules/graphs/contributors [forks-shield]: https://img.shields.io/github/forks/zachreborn/terraform-modules.svg?style=for-the-badge @@ -169,4 +167,4 @@ Project Link: [https://github.com/zachreborn/terraform-modules](https://github.c [linkedin-url]: https://www.linkedin.com/in/zachary-hill-5524257a/ [product-screenshot]: /images/screenshot.webp [Terraform.io]: https://img.shields.io/badge/Terraform-7B42BC?style=for-the-badge&logo=terraform -[Terraform-url]: https://terraform.io \ No newline at end of file +[Terraform-url]: https://terraform.io diff --git a/modules/aws/organizations/delegated_admin/README.md b/modules/aws/organizations/delegated_admin/README.md new file mode 100644 index 00000000..6286bcd0 --- /dev/null +++ b/modules/aws/organizations/delegated_admin/README.md @@ -0,0 +1,165 @@ + + + + + + + + +[![Contributors][contributors-shield]][contributors-url] +[![Forks][forks-shield]][forks-url] +[![Stargazers][stars-shield]][stars-url] +[![Issues][issues-shield]][issues-url] +[![MIT License][license-shield]][license-url] +[![LinkedIn][linkedin-shield]][linkedin-url] + + +
+
+ + Logo + + +

AWS Organization Delegated Admins Module

+

+ This module generates and manages AWS organization delegated administrators. This delegates administrative functionality of a service to an account within an organization. This module takes a map of AWS account IDs and the service principal name to associate with the account. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com. See the [AWS Organizations documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html) for more information. +
+ Explore the docs » +
+
+ Zachary Hill + · + Report Bug + · + Request Feature +

+
+ + +
+ Table of Contents +
    +
  1. Usage
  2. +
  3. Requirements
  4. +
  5. Providers
  6. +
  7. Modules
  8. +
  9. Resources
  10. +
  11. Inputs
  12. +
  13. Outputs
  14. +
  15. License
  16. +
  17. Contact
  18. +
  19. Acknowledgments
  20. +
+
+ + + +## Usage + +### Simple Example + +This example delegates administrative functionality of a service to an account. + +``` +module "organization" { + source = "github.com/zachreborn/terraform-modules//modules/aws/organizations/delegated_admin" + + delegated_admins = { + "123456789012" = "service-abbreviation.amazonaws.com", + (module.prod_network.id) = "networkmanager.amazonaws.com" + } +} +``` + +_For more examples, please refer to the [Documentation](https://github.com/zachreborn/terraform-modules)_ + +

(back to top)

+ + + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0.0 | +| [aws](#requirement\_aws) | >= 4.0.0 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 4.0.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_organizations_delegated_administrator.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/organizations_delegated_administrator) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [delegated\_admins](#input\_delegated\_admins) | (Required) Map where the keys are AWS account IDs and the value is the service principal name to associate with the account. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com. | `map(string)` | n/a | yes | + +## Outputs + +No outputs. + + + + +## License + +Distributed under the MIT License. See `LICENSE.txt` for more information. + +

(back to top)

+ + + +## Contact + +Zachary Hill - [![LinkedIn][linkedin-shield]][linkedin-url] - zhill@zacharyhill.co + +Project Link: [https://github.com/zachreborn/terraform-modules](https://github.com/zachreborn/terraform-modules) + +

(back to top)

+ + + +## Acknowledgments + +- [Zachary Hill](https://zacharyhill.co) +- [Jake Jones](https://github.com/jakeasarus) + +

(back to top)

+ + + + +[contributors-shield]: https://img.shields.io/github/contributors/zachreborn/terraform-modules.svg?style=for-the-badge +[contributors-url]: https://github.com/zachreborn/terraform-modules/graphs/contributors +[forks-shield]: https://img.shields.io/github/forks/zachreborn/terraform-modules.svg?style=for-the-badge +[forks-url]: https://github.com/zachreborn/terraform-modules/network/members +[stars-shield]: https://img.shields.io/github/stars/zachreborn/terraform-modules.svg?style=for-the-badge +[stars-url]: https://github.com/zachreborn/terraform-modules/stargazers +[issues-shield]: https://img.shields.io/github/issues/zachreborn/terraform-modules.svg?style=for-the-badge +[issues-url]: https://github.com/zachreborn/terraform-modules/issues +[license-shield]: https://img.shields.io/github/license/zachreborn/terraform-modules.svg?style=for-the-badge +[license-url]: https://github.com/zachreborn/terraform-modules/blob/master/LICENSE.txt +[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 +[linkedin-url]: https://www.linkedin.com/in/zachary-hill-5524257a/ +[product-screenshot]: /images/screenshot.webp +[Terraform.io]: https://img.shields.io/badge/Terraform-7B42BC?style=for-the-badge&logo=terraform +[Terraform-url]: https://terraform.io diff --git a/modules/aws/organizations/delegated_admin/main.tf b/modules/aws/organizations/delegated_admin/main.tf new file mode 100644 index 00000000..f6da3230 --- /dev/null +++ b/modules/aws/organizations/delegated_admin/main.tf @@ -0,0 +1,19 @@ +terraform { + required_version = ">= 1.0.0" + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 4.0.0" + } + } +} + +########################################################### +# AWS Organization Delegated Administrator +########################################################### + +resource "aws_organizations_delegated_administrator" "this" { + for_each = var.delegated_admins + account_id = each.key + service_principal = each.value +} diff --git a/modules/aws/organizations/delegated_admin/outputs.tf b/modules/aws/organizations/delegated_admin/outputs.tf new file mode 100644 index 00000000..ce8061ac --- /dev/null +++ b/modules/aws/organizations/delegated_admin/outputs.tf @@ -0,0 +1,3 @@ +########################################################### +# AWS Organization Delegated Administrator +########################################################### diff --git a/modules/aws/organizations/delegated_admin/variables.tf b/modules/aws/organizations/delegated_admin/variables.tf new file mode 100644 index 00000000..9d00cc15 --- /dev/null +++ b/modules/aws/organizations/delegated_admin/variables.tf @@ -0,0 +1,17 @@ +############################################################ +# AWS Organization Delegated Administrator +############################################################ + +variable "delegated_admins" { + description = "(Required) Map where the keys are AWS account IDs and the value is the service principal name to associate with the account. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com." + type = map(string) + # Example: + # delegated_admins = { + # "123456789012" = "service-abbreviation.amazonaws.com", + # "123456789013" = "service-abbreviation.amazonaws.com" + # } +} + +############################################################ +# General Variables +############################################################ diff --git a/modules/aws/organizations/organization/README.md b/modules/aws/organizations/organization/README.md index 72de195e..b9703c61 100644 --- a/modules/aws/organizations/organization/README.md +++ b/modules/aws/organizations/organization/README.md @@ -1,7 +1,7 @@ - + + [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] @@ -18,7 +19,6 @@ [![MIT License][license-shield]][license-url] [![LinkedIn][linkedin-shield]][linkedin-url] -
@@ -28,7 +28,7 @@

AWS Organization Module

- This module generates and manages an AWS Organization + This module generates and manages an AWS Organization.
Explore the docs »
@@ -41,7 +41,6 @@

-
Table of Contents @@ -59,18 +58,22 @@
- + ## Usage +### Simple Example + +This example creates an AWS Organization with the default settings. + ``` module "organization" { - source = "github.com/zachreborn/terraform-modules//modules/aws/organization" - + source = "github.com/zachreborn/terraform-modules//modules/aws/organizations/organization" + aws_service_access_principals = [ - "aws-artifact-account-sync.amazonaws.com", - "backup.amazonaws.com", - "cloudtrail.amazonaws.com", + "aws-artifact-account-sync.amazonaws.com", + "backup.amazonaws.com", + "cloudtrail.amazonaws.com", "sso.amazonaws.com", ] enabled_policy_types = ["TAG_POLICY"] @@ -129,15 +132,15 @@ No modules. + ## License Distributed under the MIT License. See `LICENSE.txt` for more information.

(back to top)

- - + ## Contact Zachary Hill - [![LinkedIn][linkedin-shield]][linkedin-url] - zhill@zacharyhill.co @@ -146,19 +149,18 @@ Project Link: [https://github.com/zachreborn/terraform-modules](https://github.c

(back to top)

- - + ## Acknowledgments -* [Zachary Hill](https://zacharyhill.co) -* [Jake Jones](https://github.com/jakeasarus) +- [Zachary Hill](https://zacharyhill.co) +- [Jake Jones](https://github.com/jakeasarus)

(back to top)

- + [contributors-shield]: https://img.shields.io/github/contributors/zachreborn/terraform-modules.svg?style=for-the-badge [contributors-url]: https://github.com/zachreborn/terraform-modules/graphs/contributors [forks-shield]: https://img.shields.io/github/forks/zachreborn/terraform-modules.svg?style=for-the-badge @@ -173,4 +175,4 @@ Project Link: [https://github.com/zachreborn/terraform-modules](https://github.c [linkedin-url]: https://www.linkedin.com/in/zachary-hill-5524257a/ [product-screenshot]: /images/screenshot.webp [Terraform.io]: https://img.shields.io/badge/Terraform-7B42BC?style=for-the-badge&logo=terraform -[Terraform-url]: https://terraform.io \ No newline at end of file +[Terraform-url]: https://terraform.io diff --git a/modules/aws/organizations/organization/variables.tf b/modules/aws/organizations/organization/variables.tf index 7c3acacc..c544dcd9 100644 --- a/modules/aws/organizations/organization/variables.tf +++ b/modules/aws/organizations/organization/variables.tf @@ -30,3 +30,7 @@ variable "feature_set" { error_message = "Value must be ALL or CONSOLIDATED_BILLING." } } + +############################################################ +# General Variables +############################################################