Skip to content

Commit 83e0607

Browse files
authored
Merge pull request #4721 from ameukam/aws-workloads-accounts
AWS: create more accounts
2 parents cd9e71d + acddf24 commit 83e0607

File tree

4 files changed

+107
-9
lines changed

4 files changed

+107
-9
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
18+
module "infra_shared_services" {
19+
source = "../modules/org-account"
20+
21+
account_name = "k8s-infra-shared-services"
22+
23+
iam_user_access_to_billing = "ALLOW"
24+
parent_id = aws_organizations_organizational_unit.infrastructure.id
25+
}
26+
27+
module "infra_network" {
28+
source = "../modules/org-account"
29+
30+
account_name = "k8s-infra-shared-services"
31+
32+
iam_user_access_to_billing = "ALLOW"
33+
parent_id = aws_organizations_organizational_unit.infrastructure.id
34+
}

infra/aws/terraform/management-account/accounts.tf renamed to infra/aws/terraform/management-account/organization-accounts-security.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ module "security_audit" {
2323
parent_id = aws_organizations_organizational_unit.security.id
2424
}
2525

26+
module "security_engineering" {
27+
source = "../modules/org-account"
28+
29+
account_name = "k8s-infra-security-engineering"
30+
31+
iam_user_access_to_billing = "ALLOW"
32+
parent_id = aws_organizations_organizational_unit.security.id
33+
}
34+
2635
module "security_incident_response" {
2736
source = "../modules/org-account"
2837

@@ -39,12 +48,3 @@ module "security_logs" {
3948
iam_user_access_to_billing = "ALLOW"
4049
parent_id = aws_organizations_organizational_unit.security.id
4150
}
42-
43-
module "infra_shared_services" {
44-
source = "../modules/org-account"
45-
46-
account_name = "k8s-infra-shared-services"
47-
48-
iam_user_access_to_billing = "ALLOW"
49-
parent_id = aws_organizations_organizational_unit.infrastructure.id
50-
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
module "artifacts-k8s-io" {
18+
source = "../modules/org-account"
19+
20+
account_name = "k8s-infra-security-logs"
21+
22+
parent_id = aws_organizations_organizational_unit.production.id
23+
}

infra/aws/terraform/management-account/organizational-units.tf

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
/*
18+
This file contains :
19+
- Organizational Units of the AWS organization
20+
*/
21+
1722
resource "aws_organizations_organizational_unit" "security" {
1823
name = "Security"
1924
parent_id = aws_organizations_organization.default.roots[0].id
@@ -31,3 +36,39 @@ resource "aws_organizations_organizational_unit" "infrastructure" {
3136
prevent_destroy = true
3237
}
3338
}
39+
40+
resource "aws_organizations_organizational_unit" "workloads" {
41+
name = "Workloads"
42+
parent_id = aws_organizations_organization.default.roots[0].id
43+
44+
lifecycle {
45+
prevent_destroy = true
46+
}
47+
}
48+
49+
resource "aws_organizations_organizational_unit" "production" {
50+
name = "Production"
51+
parent_id = aws_organizations_organizational_unit.workloads.id
52+
53+
lifecycle {
54+
prevent_destroy = true
55+
}
56+
}
57+
58+
resource "aws_organizations_organizational_unit" "non_production" {
59+
name = "Non-Production"
60+
parent_id = aws_organizations_organizational_unit.workloads.id
61+
62+
lifecycle {
63+
prevent_destroy = true
64+
}
65+
}
66+
67+
resource "aws_organizations_organizational_unit" "boskos" {
68+
name = "Boskos"
69+
parent_id = aws_organizations_organizational_unit.workloads.id
70+
71+
lifecycle {
72+
prevent_destroy = true
73+
}
74+
}

0 commit comments

Comments
 (0)