File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ # NOTE: Organization can only be created from the master account
2
+ # https://www.terraform.io/docs/providers/aws/r/organizations_organization.html
3
+
4
+ terraform {
5
+ required_version = " >= 0.11.2"
6
+
7
+ backend "s3" {}
8
+ }
9
+
10
+ variable "aws_assume_role_arn" {
11
+ type = " string"
12
+ }
13
+
14
+ variable "organization_feature_set" {
15
+ type = " string"
16
+ default = " ALL"
17
+ description = " Specify `ALL` (default) or `CONSOLIDATED_BILLING`"
18
+ }
19
+
20
+ provider "aws" {
21
+ assume_role {
22
+ role_arn = " ${ var . aws_assume_role_arn } "
23
+ }
24
+ }
25
+
26
+ resource "aws_organizations_organization" "default" {
27
+ feature_set = " ${ var . organization_feature_set } "
28
+ }
29
+
30
+ output "organization_id" {
31
+ value = " ${ aws_organizations_organization . default . id } "
32
+ }
33
+
34
+ output "organization_arn" {
35
+ value = " ${ aws_organizations_organization . default . arn } "
36
+ }
37
+
38
+ output "organization_master_account_id" {
39
+ value = " ${ aws_organizations_organization . default . master_account_id } "
40
+ }
41
+
42
+ output "organization_master_account_arn" {
43
+ value = " ${ aws_organizations_organization . default . master_account_arn } "
44
+ }
45
+
46
+ output "organization_master_account_email" {
47
+ value = " ${ aws_organizations_organization . default . master_account_email } "
48
+ }
Original file line number Diff line number Diff line change
1
+ organization_feature_set="ALL"
You can’t perform that action at this time.
0 commit comments