Skip to content

Commit 955e3d0

Browse files
authored
Add organization project (#9)
1 parent 9fd29a6 commit 955e3d0

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

aws/organization/main.tf

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
organization_feature_set="ALL"

0 commit comments

Comments
 (0)