Skip to content

Commit

Permalink
Merge pull request #872 from ministryofjustice/feature/remove-cp-tran…
Browse files Browse the repository at this point in the history
…sit-gateways

Remove cloud platform transit gateways account
  • Loading branch information
davidkelliott authored Feb 28, 2024
2 parents 6248e86 + 64fb21d commit 9316172
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 32 deletions.
12 changes: 9 additions & 3 deletions management-account/terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -216,25 +216,3 @@ resource "aws_organizations_account" "network_architecture" {
]
}
}

resource "aws_organizations_account" "cloud_platform_transit_gateways" {
name = "Cloud Platform Transit Gateways"
email = replace(local.aws_account_email_addresses_template, "{email}", "cloud-platform-transit-gateways")
iam_user_access_to_billing = "ALLOW"
parent_id = aws_organizations_organizational_unit.technology_services.id

tags = merge(local.tags_technology_services, {
is-production = true
application = "Core Transit Gateway"
source-code = "github.com/ministryofjustice/transit-gateways"
})

lifecycle {
ignore_changes = [
email,
iam_user_access_to_billing,
name,
role_name,
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ resource "aws_organizations_policy_attachment" "deny_aws_account_root_user_opg"
target_id = aws_organizations_organizational_unit.opg.id
}

resource "aws_organizations_policy_attachment" "deny_aws_account_root_user_cloud_platform_transit_gateways" {
policy_id = aws_organizations_policy.deny_aws_account_root_user.id
target_id = aws_organizations_account.cloud_platform_transit_gateways.id
}

#####################################
# Deny all actions on all resources #
#####################################
Expand Down
2 changes: 0 additions & 2 deletions management-account/terraform/sso-admin-account-assignments.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ locals {
account_ids = [
aws_organizations_account.cloud_platform.id,
aws_organizations_account.cloud_platform_ephemeral_test.id,
aws_organizations_account.cloud_platform_transit_gateways.id
]
},
{
Expand Down Expand Up @@ -176,7 +175,6 @@ locals {
github_team = "modernisation-platform-engineers",
permission_set_arn = aws_ssoadmin_permission_set.read_only_access.arn,
account_ids = [
aws_organizations_account.cloud_platform_transit_gateways.id,
aws_organizations_account.moj_official_production.id,
aws_organizations_account.moj_official_shared_services.id,
]
Expand Down

0 comments on commit 9316172

Please sign in to comment.