{"id":21202445,"url":"https://github.com/infrablocks/terraform-aws-organization","last_synced_at":"2026-03-05T03:31:27.391Z","repository":{"id":38333063,"uuid":"214649863","full_name":"infrablocks/terraform-aws-organization","owner":"infrablocks","description":"A Terraform module for managing an AWS Organisation.","archived":false,"fork":false,"pushed_at":"2026-02-26T20:54:10.000Z","size":583,"stargazers_count":54,"open_issues_count":1,"forks_count":22,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-02-27T02:11:44.118Z","etag":null,"topics":["aws","infrastructure","organization","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infrablocks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-12T13:14:08.000Z","updated_at":"2026-02-26T20:54:13.000Z","dependencies_parsed_at":"2023-12-11T21:28:41.468Z","dependency_job_id":"3249ab35-d7b0-4093-a000-35c9e1eb7f87","html_url":"https://github.com/infrablocks/terraform-aws-organization","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/infrablocks/terraform-aws-organization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Fterraform-aws-organization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Fterraform-aws-organization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Fterraform-aws-organization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Fterraform-aws-organization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infrablocks","download_url":"https://codeload.github.com/infrablocks/terraform-aws-organization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Fterraform-aws-organization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30108604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T01:39:18.192Z","status":"online","status_checked_at":"2026-03-05T02:00:06.710Z","response_time":93,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","infrastructure","organization","terraform","terraform-modules"],"created_at":"2024-11-20T20:15:58.877Z","updated_at":"2026-03-05T03:31:27.371Z","avatar_url":"https://github.com/infrablocks.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Terraform AWS Organisation\n==========================\n\n[![CircleCI](https://circleci.com/gh/infrablocks/terraform-aws-organization.svg?style=svg)](https://circleci.com/gh/infrablocks/terraform-aws-organization)\n\nA Terraform module for managing an AWS Organisation.\n\nThe Organisation deployment has no requirements.\n\nThe Organisation deployment consists of:\n\n* an AWS organisation\n* with a hierarchy of organisational units\n* with a set of accounts placed in that hierarchy\n\nUsage\n-----\n\nTo use the module, include something like the following in your Terraform\nconfiguration:\n\n```hcl-terraform\nmodule \"organisation\" {\n  source  = \"infrablocks/organization/aws\"\n  version = \"2.0.0\"\n\n  feature_set                   = \"ALL\"\n  aws_service_access_principals = [\n    \"cloudtrail.amazonaws.com\",\n    \"config.amazonaws.com\"\n  ]\n  enabled_policy_types = [\n    \"SERVICE_CONTROL_POLICY\",\n    \"TAG_POLICY\"\n  ]\n\n  organization = {\n    accounts = [\n      {\n        name  = \"Default\"\n        key   = \"mycompany-default\"\n        email = \"root@company.com\"\n      }\n    ]\n    units = [\n      {\n        name  = \"MyProduct\",\n        key   = \"mycompany-myproduct\"\n        units = [\n          {\n            name     = \"Development\",\n            key      = \"mycompany-myproduct-development\"\n            accounts = [\n              {\n                name  = \"Blue\"\n                key   = \"mycompany-myproduct-development-blue\"\n                email = \"development@company.com\"\n              }\n            ]\n          },\n          {\n            name     = \"Production\",\n            key      = \"mycompany-myproduct-production\"\n            accounts = [\n              {\n                name  = \"Blue\"\n                key   = \"mycompany-myproduct-production-blue\"\n                email = \"production@company.com\"\n              }\n            ]\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nNote: `organization` can be nested up to 5 levels deep. Levels 1 through 4 may\ninclude\na `units` property, although it can be an empty array. Level 5 must not include\na `units` property.\n\nSee the\n[Terraform registry entry](https://registry.terraform.io/modules/infrablocks/organization/aws/latest)\nfor more details.\n\n### Inputs\n\n| Name                          | Description                                                                                                                           | Default | Required |\n|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|:-------:|:--------:|\n| feature_set                   | The feature set to enable for the organization (one of \"ALL\" or \"CONSOLIDATED_BILLING\")                                               |   ALL   |    no    |\n| aws_service_access_principals | A list of AWS service principal names for which you want to enable integration with your organization.                                |   []    |    no    |\n| organization                  | The tree of organizational units and accounts to construct. Defaults to an empty tree.                                                |   []    |    no    |\n| enabled_policy_types          | The list of Organizations policy types to enable in the Organization Root. The organization must have `feature_set` set to `\\\"ALL\\\"`. |   []    |    no    |\n\n### Outputs\n\n| Name                 | Description                                   |\n|----------------------|-----------------------------------------------|\n| organization_arn     | The ARN of the resulting organization         |\n| organizational_units | Details of the resulting organizational units |\n| accounts             | Details of the resulting accounts             |\n\n### Compatibility\n\nThis module is compatible with Terraform versions greater than or equal to\nTerraform 1.3.\n\nDevelopment\n-----------\n\n### Machine Requirements\n\nIn order for the build to run correctly, a few tools will need to be installed\non your development machine:\n\n* Ruby (3.1.1)\n* Bundler\n* git\n* git-crypt\n* gnupg\n* direnv\n* aws-vault\n\n#### Mac OS X Setup\n\nInstalling the required tools is best managed by [homebrew](http://brew.sh).\n\nTo install homebrew:\n\n```\nruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n```\n\nThen, to install the required tools:\n\n```\n# ruby\nbrew install rbenv\nbrew install ruby-build\necho 'eval \"$(rbenv init - bash)\"' \u003e\u003e ~/.bash_profile\necho 'eval \"$(rbenv init - zsh)\"' \u003e\u003e ~/.zshrc\neval \"$(rbenv init -)\"\nrbenv install 3.1.1\nrbenv rehash\nrbenv local 3.1.1\ngem install bundler\n\n# git, git-crypt, gnupg\nbrew install git\nbrew install git-crypt\nbrew install gnupg\n\n# aws-vault\nbrew cask install\n\n# direnv\nbrew install direnv\necho \"$(direnv hook bash)\" \u003e\u003e ~/.bash_profile\necho \"$(direnv hook zsh)\" \u003e\u003e ~/.zshrc\neval \"$(direnv hook $SHELL)\"\n\ndirenv allow \u003crepository-directory\u003e\n```\n\n### Running the build\n\nRunning the build requires an AWS account and AWS credentials. You are free to\nconfigure credentials however you like as long as an access key ID and secret\naccess key are available. These instructions utilise\n[aws-vault](https://github.com/99designs/aws-vault) which makes credential\nmanagement easy and secure.\n\nTo provision module infrastructure, run tests and then destroy that\ninfrastructure, execute:\n\n```bash\naws-vault exec \u003cprofile\u003e -- ./go\n```\n\nTo provision the module prerequisites:\n\n```bash\naws-vault exec \u003cprofile\u003e -- ./go deployment:prerequisites:provision[\u003cdeployment_identifier\u003e]\n```\n\nTo provision the module contents:\n\n```bash\naws-vault exec \u003cprofile\u003e -- ./go deployment:root:provision[\u003cdeployment_identifier\u003e]\n```\n\nTo destroy the module contents:\n\n```bash\naws-vault exec \u003cprofile\u003e -- ./go deployment:root:destroy[\u003cdeployment_identifier\u003e]\n```\n\nTo destroy the module prerequisites:\n\n```bash\naws-vault exec \u003cprofile\u003e -- ./go deployment:prerequisites:destroy[\u003cdeployment_identifier\u003e]\n```\n\nConfiguration parameters can be overridden via environment variables:\n\n```bash\nDEPLOYMENT_IDENTIFIER=testing aws-vault exec \u003cprofile\u003e -- ./go\n```\n\nWhen a deployment identifier is provided via an environment variable,\ninfrastructure will not be destroyed at the end of test execution. This can\nbe useful during development to avoid lengthy provision and destroy cycles.\n\nBy default, providers will be downloaded for each terraform execution. To\ncache providers between calls:\n\n```bash\nTF_PLUGIN_CACHE_DIR=\"$HOME/.terraform.d/plugin-cache\" aws-vault exec \u003cprofile\u003e -- ./go\n```\n\n### Common Tasks\n\n#### Generating an SSH key pair\n\nTo generate an SSH key pair:\n\n```\nssh-keygen -m PEM -t rsa -b 4096 -C integration-test@example.com -N '' -f config/secrets/keys/bastion/ssh\n```\n\n#### Generating a self-signed certificate\n\nTo generate a self signed certificate:\n\n```\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365\n```\n\nTo decrypt the resulting key:\n\n```\nopenssl rsa -in key.pem -out ssl.key\n```\n\n#### Managing CircleCI keys\n\nTo encrypt a GPG key for use by CircleCI:\n\n```bash\nopenssl aes-256-cbc \\\n  -e \\\n  -md sha1 \\\n  -in ./config/secrets/ci/gpg.private \\\n  -out ./.circleci/gpg.private.enc \\\n  -k \"\u003cpassphrase\u003e\"\n```\n\nTo check decryption is working correctly:\n\n```bash\nopenssl aes-256-cbc \\\n  -d \\\n  -md sha1 \\\n  -in ./.circleci/gpg.private.enc \\\n  -k \"\u003cpassphrase\u003e\"\n```\n\nContributing\n------------\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/infrablocks/terraform-aws-organisation.\nThis project is intended to be a safe, welcoming space for collaboration, and\ncontributors are expected to adhere to\nthe [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\nLicense\n-------\n\nThe library is available as open source under the terms of the\n[MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfrablocks%2Fterraform-aws-organization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfrablocks%2Fterraform-aws-organization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfrablocks%2Fterraform-aws-organization/lists"}