generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 290
/
locals.tf
26 lines (22 loc) · 1.36 KB
/
locals.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This data sources allows us to get the Modernisation Platform account information for use elsewhere
# (when we want to assume a role in the MP, for instance)
data "aws_organizations_organization" "root_account" {}
data "aws_organizations_organizational_units" "root_ous" {
parent_id = data.aws_organizations_organization.root_account.roots[0].id
}
data "aws_organizations_organizational_units" "platforms_architecture" {
parent_id = join("", [for ou in data.aws_organizations_organizational_units.root_ous.children : ou.id if ou.name == "Platforms & Architecture"])
}
data "aws_caller_identity" "current" {}
locals {
environments = {
business-unit = "Platforms"
application = "Modernisation Platform: Environments Management"
is-production = true
owner = "Modernisation Platform: [email protected]"
}
root_account = data.aws_organizations_organization.root_account
modernisation_platform_account = local.root_account.accounts[index(local.root_account.accounts[*].email, "[email protected]")]
github_repository = "github.com:ministryofjustice/modernisation-platform.git"
modernisation_platform_ou_id = join("", [for ou in data.aws_organizations_organizational_units.platforms_architecture.children : ou.id if ou.name == "Modernisation Platform"])
}