Skip to content

Latest commit

 

History

History
120 lines (87 loc) · 4.75 KB

File metadata and controls

120 lines (87 loc) · 4.75 KB

terraform-aws-organizations-account

CircleCI GitHub tag License

Terraform module which creates AWS Organizations Account resources on AWS.

Description

Provision AWS Account.

This module provides recommended settings:

  • Enable access to billing
  • Use OrganizationAccountAccessRole

Usage

Minimal

module "organizations_account" {
  source = "git::https://github.com/tmknom/terraform-aws-organizations-account.git?ref=tags/1.0.0"
  name   = "example"
  email  = "[email protected]"
}

Complete

module "organizations_account" {
  source = "git::https://github.com/tmknom/terraform-aws-organizations-account.git?ref=tags/1.0.0"
  name   = "example"
  email  = "[email protected]"

  iam_user_access_to_billing = "DENY"
  role_name                  = "OrganizationAccountAccessRole"
  enabled                    = true
}

Examples

Inputs

Name Description Type Default Required
email The email address of the owner to assign to the new member account. string - yes
name A friendly name for the member account. string - yes
enabled Set to false to prevent the module from creating anything. string true no
iam_user_access_to_billing If set to ALLOW, the new account enables IAM users to access account billing information. string ALLOW no
role_name The name of an IAM role that Organizations automatically preconfigures in the new member account. string OrganizationAccountAccessRole no

Outputs

Name Description
organizations_account_arn The ARN for this account.
organizations_account_id The AWS account id.
organizations_account_name The AWS account name.

Development

Requirements

Configure environment variables

export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export AWS_DEFAULT_REGION=ap-northeast-1

Installation

git clone [email protected]:tmknom/terraform-aws-organizations-account.git
cd terraform-aws-organizations-account
make install

Makefile targets

check-format                   Check format code
cibuild                        Execute CI build
clean                          Clean .terraform
docs                           Generate docs
format                         Format code
help                           Show help
install                        Install requirements
lint                           Lint code
release                        Release GitHub and Terraform Module Registry
terraform-apply-complete       Run terraform apply examples/complete
terraform-apply-minimal        Run terraform apply examples/minimal
terraform-destroy-complete     Run terraform destroy examples/complete
terraform-destroy-minimal      Run terraform destroy examples/minimal
terraform-plan-complete        Run terraform plan examples/complete
terraform-plan-minimal         Run terraform plan examples/minimal
upgrade                        Upgrade makefile

Releasing new versions

Bump VERSION file, and run make release.

Terraform Module Registry

License

Apache 2 Licensed. See LICENSE for full details.