File tree Expand file tree Collapse file tree 16 files changed +128
-64
lines changed Expand file tree Collapse file tree 16 files changed +128
-64
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- variable "audit_account_id" {
2- type = " string"
3- description = " Audit account ID"
4- }
5-
61variable "audit_account_user_names" {
72 type = " list"
8- description = " IAM user names to grant access to Audit account"
3+ description = " IAM user names to grant access to the `audit` account"
4+ default = []
95}
106
117# Provision group access to audit account. Careful! Very few people, if any should have access to this account.
128module "organization_access_group_audit" {
13- source = " git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.1.3"
9+ source = " git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.2.1"
10+ enabled = " ${ contains (var. accounts_enabled , " audit" ) == true ? " true" : " false" } "
1411 namespace = " ${ var . namespace } "
1512 stage = " audit"
1613 name = " admin"
17- user_names = [ " ${ var . audit_account_user_names } " ]
18- member_account_id = " ${ var . audit_account_id } "
14+ user_names = " ${ var . audit_account_user_names } "
15+ member_account_id = " ${ data . terraform_remote_state . accounts . audit_account_id } "
1916 require_mfa = " true"
2017}
Original file line number Diff line number Diff line change 1+ variable "corp_account_user_names" {
2+ type = " list"
3+ description = " IAM user names to grant access to the `corp` account"
4+ default = []
5+ }
6+
7+ # Provision group access to corp account
8+ module "organization_access_group_corp" {
9+ source = " git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.2.1"
10+ enabled = " ${ contains (var. accounts_enabled , " corp" ) == true ? " true" : " false" } "
11+ namespace = " ${ var . namespace } "
12+ stage = " corp"
13+ name = " admin"
14+ user_names = " ${ var . corp_account_user_names } "
15+ member_account_id = " ${ data . terraform_remote_state . accounts . corp_account_id } "
16+ require_mfa = " true"
17+ }
Original file line number Diff line number Diff line change 1+ variable "data_account_user_names" {
2+ type = " list"
3+ description = " IAM user names to grant access to the `data` account"
4+ default = []
5+ }
6+
7+ # Provision group access to data account
8+ module "organization_access_group_data" {
9+ source = " git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.2.1"
10+ enabled = " ${ contains (var. accounts_enabled , " data" ) == true ? " true" : " false" } "
11+ namespace = " ${ var . namespace } "
12+ stage = " data"
13+ name = " admin"
14+ user_names = " ${ var . data_account_user_names } "
15+ member_account_id = " ${ data . terraform_remote_state . accounts . data_account_id } "
16+ require_mfa = " true"
17+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- variable "dev_account_id" {
2- type = " string"
3- description = " Dev account ID"
4- }
5-
61variable "dev_account_user_names" {
72 type = " list"
8- description = " IAM user names to grant access to Dev account"
3+ description = " IAM user names to grant access to the `dev` account"
4+ default = []
95}
106
117# Provision group access to dev account
128module "organization_access_group_dev" {
13- source = " git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.1.3"
9+ source = " git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.2.1"
10+ enabled = " ${ contains (var. accounts_enabled , " dev" ) == true ? " true" : " false" } "
1411 namespace = " ${ var . namespace } "
1512 stage = " dev"
1613 name = " admin"
17- user_names = [ " ${ var . dev_account_user_names } " ]
18- member_account_id = " ${ var . dev_account_id } "
14+ user_names = " ${ var . dev_account_user_names } "
15+ member_account_id = " ${ data . terraform_remote_state . accounts . dev_account_id } "
1916 require_mfa = " true"
2017}
Original file line number Diff line number Diff line change 1+ variable "identity_account_user_names" {
2+ type = " list"
3+ description = " IAM user names to grant access to the `identity` account"
4+ default = []
5+ }
6+
7+ # Provision group access to identity account
8+ module "organization_access_group_identity" {
9+ source = " git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.2.1"
10+ enabled = " ${ contains (var. accounts_enabled , " identity" ) == true ? " true" : " false" } "
11+ namespace = " ${ var . namespace } "
12+ stage = " identity"
13+ name = " admin"
14+ user_names = " ${ var . identity_account_user_names } "
15+ member_account_id = " ${ data . terraform_remote_state . accounts . identity_account_id } "
16+ require_mfa = " true"
17+ }
Original file line number Diff line number Diff line change @@ -4,17 +4,19 @@ terraform {
44 backend "s3" {}
55}
66
7- variable "aws_assume_role_arn" {
8- type = " string"
9- }
10-
11- variable "namespace" {
12- type = " string"
13- description = " Namespace (e.g. `cp` or `cloudposse`)"
14- }
15-
167provider "aws" {
178 assume_role {
189 role_arn = " ${ var . aws_assume_role_arn } "
1910 }
2011}
12+
13+ data "terraform_remote_state" "accounts" {
14+ backend = " s3"
15+
16+ config {
17+ bucket = " ${ var . namespace } -${ var . stage } -terraform-state"
18+ key = " accounts/terraform.tfstate"
19+ }
20+ }
21+
22+ locals {}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- variable "prod_account_id" {
2- type = " string"
3- description = " Production account ID"
4- }
5-
61variable "prod_account_user_names" {
72 type = " list"
8- description = " IAM user names to grant access to Production account"
3+ description = " IAM user names to grant access to the `prod` account"
4+ default = []
95}
106
117# Provision group access to production account
128module "organization_access_group_prod" {
13- source = " git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.1.3"
9+ source = " git::https://github.com/cloudposse/terraform-aws-organization-access-group.git?ref=tags/0.2.1"
10+ enabled = " ${ contains (var. accounts_enabled , " prod" ) == true ? " true" : " false" } "
1411 namespace = " ${ var . namespace } "
1512 stage = " prod"
1613 name = " admin"
17- user_names = [ " ${ var . prod_account_user_names } " ]
18- member_account_id = " ${ var . prod_account_id } "
14+ user_names = " ${ var . prod_account_user_names } "
15+ member_account_id = " ${ data . terraform_remote_state . accounts . prod_account_id } "
1916 require_mfa = " true"
2017}
You can’t perform that action at this time.
0 commit comments