Skip to content

Commit

Permalink
Add organization project (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
aknysh authored Jun 5, 2018
1 parent 9fd29a6 commit 955e3d0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions aws/organization/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# NOTE: Organization can only be created from the master account
# https://www.terraform.io/docs/providers/aws/r/organizations_organization.html

terraform {
required_version = ">= 0.11.2"

backend "s3" {}
}

variable "aws_assume_role_arn" {
type = "string"
}

variable "organization_feature_set" {
type = "string"
default = "ALL"
description = "Specify `ALL` (default) or `CONSOLIDATED_BILLING`"
}

provider "aws" {
assume_role {
role_arn = "${var.aws_assume_role_arn}"
}
}

resource "aws_organizations_organization" "default" {
feature_set = "${var.organization_feature_set}"
}

output "organization_id" {
value = "${aws_organizations_organization.default.id}"
}

output "organization_arn" {
value = "${aws_organizations_organization.default.arn}"
}

output "organization_master_account_id" {
value = "${aws_organizations_organization.default.master_account_id}"
}

output "organization_master_account_arn" {
value = "${aws_organizations_organization.default.master_account_arn}"
}

output "organization_master_account_email" {
value = "${aws_organizations_organization.default.master_account_email}"
}
1 change: 1 addition & 0 deletions aws/organization/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
organization_feature_set="ALL"

0 comments on commit 955e3d0

Please sign in to comment.