-
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add projects from `root` stage. Add `account` project * Rename to `accounts` * Add `account-dns` * Update `accounts` and `iam` projects
- Loading branch information
Showing
37 changed files
with
437 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
terraform { | ||
required_version = ">= 0.11.2" | ||
|
||
backend "s3" {} | ||
} | ||
|
||
variable "aws_assume_role_arn" { | ||
type = "string" | ||
} | ||
|
||
variable "domain_name" { | ||
type = "string" | ||
description = "Domain name" | ||
} | ||
|
||
provider "aws" { | ||
assume_role { | ||
role_arn = "${var.aws_assume_role_arn}" | ||
} | ||
} | ||
|
||
resource "aws_route53_zone" "dns_zone" { | ||
name = "${var.domain_name}" | ||
} | ||
|
||
resource "aws_route53_record" "dns_zone_soa" { | ||
zone_id = "${aws_route53_zone.dns_zone.id}" | ||
name = "${aws_route53_zone.dns_zone.name}" | ||
type = "SOA" | ||
ttl = "60" | ||
|
||
records = [ | ||
"${aws_route53_zone.dns_zone.name_servers.0}. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400", | ||
] | ||
} | ||
|
||
output "zone_id" { | ||
value = "${aws_route53_zone.dns_zone.zone_id}" | ||
} | ||
|
||
output "name_servers" { | ||
value = "${aws_route53_zone.dns_zone.name_servers}" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
audit_account_name="audit" | ||
audit_account_email="[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
variable "audit_account_name" { | ||
type = "string" | ||
description = "Audit account name" | ||
default = "audit" | ||
} | ||
|
||
variable "audit_account_email" { | ||
type = "string" | ||
description = "Audit account email" | ||
} | ||
|
||
resource "aws_organizations_account" "audit" { | ||
name = "${var.audit_account_name}" | ||
email = "${var.audit_account_email}" | ||
iam_user_access_to_billing = "${var.account_iam_user_access_to_billing}" | ||
role_name = "${var.account_role_name}" | ||
} | ||
|
||
output "audit_account_arn" { | ||
value = "${aws_organizations_account.audit.arn}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dev_account_name="dev" | ||
dev_account_email="[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
variable "dev_account_name" { | ||
type = "string" | ||
description = "Dev account name" | ||
default = "dev" | ||
} | ||
|
||
variable "dev_account_email" { | ||
type = "string" | ||
description = "Dev account email" | ||
} | ||
|
||
resource "aws_organizations_account" "dev" { | ||
name = "${var.dev_account_name}" | ||
email = "${var.dev_account_email}" | ||
iam_user_access_to_billing = "${var.account_iam_user_access_to_billing}" | ||
role_name = "${var.account_role_name}" | ||
} | ||
|
||
output "dev_account_arn" { | ||
value = "${aws_organizations_account.dev.arn}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
terraform { | ||
required_version = ">= 0.11.2" | ||
|
||
backend "s3" {} | ||
} | ||
|
||
variable "aws_assume_role_arn" { | ||
type = "string" | ||
} | ||
|
||
variable "account_role_name" { | ||
type = "string" | ||
description = "IAM role that Organization automatically preconfigures in the new member account" | ||
default = "OrganizationAccountAccessRole" | ||
} | ||
|
||
variable "account_iam_user_access_to_billing" { | ||
type = "string" | ||
description = "If set to `ALLOW`, the new account enables IAM users to access account billing information if they have the required permissions. If set to `DENY`, then only the root user of the new account can access account billing information" | ||
default = "DENY" | ||
} | ||
|
||
provider "aws" { | ||
assume_role { | ||
role_arn = "${var.aws_assume_role_arn}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
prod_account_name="prod" | ||
prod_account_email="[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
variable "prod_account_name" { | ||
type = "string" | ||
description = "Production account name" | ||
default = "prod" | ||
} | ||
|
||
variable "prod_account_email" { | ||
type = "string" | ||
description = "Production account email" | ||
} | ||
|
||
resource "aws_organizations_account" "prod" { | ||
name = "${var.prod_account_name}" | ||
email = "${var.prod_account_email}" | ||
iam_user_access_to_billing = "${var.account_iam_user_access_to_billing}" | ||
role_name = "${var.account_role_name}" | ||
} | ||
|
||
output "prod_account_arn" { | ||
value = "${aws_organizations_account.prod.arn}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
staging_account_name="staging" | ||
staging_account_email="[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
variable "staging_account_name" { | ||
type = "string" | ||
description = "Staging account name" | ||
default = "staging" | ||
} | ||
|
||
variable "staging_account_email" { | ||
type = "string" | ||
description = "Staging account email" | ||
} | ||
|
||
resource "aws_organizations_account" "staging" { | ||
name = "${var.staging_account_name}" | ||
email = "${var.staging_account_email}" | ||
iam_user_access_to_billing = "${var.account_iam_user_access_to_billing}" | ||
role_name = "${var.account_role_name}" | ||
} | ||
|
||
output "staging_account_arn" { | ||
value = "${aws_organizations_account.staging.arn}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
audit_account_id="" | ||
audit_account_user_names=["", "",] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
variable "audit_account_id" { | ||
type = "string" | ||
description = "Audit account ID" | ||
} | ||
|
||
variable "audit_account_user_names" { | ||
type = "list" | ||
description = "IAM user names to grant access to Audit account" | ||
} | ||
|
||
# Provision group access to audit account. Careful! Very few people, if any should have access to this account. | ||
module "organization_access_group_audit" { | ||
source = "git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.1.2" | ||
namespace = "${var.namespace}" | ||
stage = "audit" | ||
name = "admin" | ||
user_names = ["${var.audit_account_user_names}"] | ||
member_account_id = "${var.audit_account_id}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dev_account_id="" | ||
dev_account_user_names=["", "",] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
variable "dev_account_id" { | ||
type = "string" | ||
description = "Dev account ID" | ||
} | ||
|
||
variable "dev_account_user_names" { | ||
type = "list" | ||
description = "IAM user names to grant access to Dev account" | ||
} | ||
|
||
# Provision group access to dev account | ||
module "organization_access_group_dev" { | ||
source = "git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.1.2" | ||
namespace = "${var.namespace}" | ||
stage = "dev" | ||
name = "admin" | ||
user_names = ["${var.dev_account_user_names}"] | ||
member_account_id = "${var.dev_account_id}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
terraform { | ||
required_version = ">= 0.11.2" | ||
|
||
backend "s3" {} | ||
} | ||
|
||
variable "aws_assume_role_arn" { | ||
type = "string" | ||
} | ||
|
||
variable "namespace" { | ||
type = "string" | ||
description = "Namespace (e.g. `cp` or `cloudposse`)" | ||
} | ||
|
||
provider "aws" { | ||
assume_role { | ||
role_arn = "${var.aws_assume_role_arn}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
prod_account_id="" | ||
prod_account_user_names=["", "",] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
variable "prod_account_id" { | ||
type = "string" | ||
description = "Production account ID" | ||
} | ||
|
||
variable "prod_account_user_names" { | ||
type = "list" | ||
description = "IAM user names to grant access to Production account" | ||
} | ||
|
||
# Provision group access to production account | ||
module "organization_access_group_prod" { | ||
source = "git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.1.2" | ||
namespace = "${var.namespace}" | ||
stage = "prod" | ||
name = "admin" | ||
user_names = ["${var.prod_account_user_names}"] | ||
member_account_id = "${var.prod_account_id}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
root_account_admin_user_names=["", "",] | ||
root_account_readonly_user_names=["", "",] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
variable "root_account_admin_user_names" { | ||
type = "list" | ||
description = "IAM user names to grant admin access to Root account" | ||
} | ||
|
||
variable "root_account_readonly_user_names" { | ||
type = "list" | ||
description = "IAM user names to grant readonly access to Root account" | ||
default = [] | ||
} | ||
|
||
# Provision group access to root account with MFA | ||
module "organization_access_group_root" { | ||
source = "git::https://github.com/cloudposse/terraform-aws-iam-assumed-roles.git?ref=tags/0.2.0" | ||
namespace = "${var.namespace}" | ||
stage = "root" | ||
admin_name = "admin" | ||
readonly_name = "readonly" | ||
admin_user_names = ["${var.root_account_admin_user_names}"] | ||
readonly_user_names = ["${var.root_account_readonly_user_names}"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
staging_account_id="" | ||
staging_account_user_names=["", "",] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
variable "staging_account_id" { | ||
type = "string" | ||
description = "Staging account ID" | ||
} | ||
|
||
variable "staging_account_user_names" { | ||
type = "list" | ||
description = "IAM user names to grant access to Staging account" | ||
} | ||
|
||
# Provision group access to staging account | ||
module "organization_access_group_staging" { | ||
source = "git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.1.2" | ||
namespace = "${var.namespace}" | ||
stage = "staging" | ||
name = "admin" | ||
user_names = ["${var.staging_account_user_names}"] | ||
member_account_id = "${var.staging_account_id}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace="cp" | ||
stage="staging" | ||
region="us-west-2" | ||
zone_name="us-west-2.cloudposse.co" | ||
zone_name="us-west-2.staging.cloudposse.co" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.