Skip to content

Commit 8d08187

Browse files
Construct boundary ARN instead of data source lookup (#94)
## Summary The boundary policy has `team=javabin` from org default_tags. The `DenyCrossTeamAccess` deny blocks `iam:GetPolicy` on it. Instead of tagging it shared (wrong semantics), construct the deterministic ARN: `arn:aws:iam::{account_id}:policy/javabin-developer-boundary`. Zero IAM API calls. ## Test plan - [ ] Merge, wait for apply, retrigger test app CI
1 parent 20b3769 commit 8d08187

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

scripts/registry.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@
6060
"ecs_cluster_name": "data.aws_ecs_cluster.platform_main.cluster_name",
6161
"execution_role_arn": "data.aws_iam_role.platform_ecs_execution.arn",
6262
"route53_zone_id": "data.aws_route53_zone.platform_main.zone_id",
63-
"developer_boundary_arn": "data.aws_iam_policy.platform_developer_boundary.arn",
63+
# Boundary ARN constructed from account ID — no data source needed.
64+
# Avoids iam:GetPolicy permission requirement on the boundary policy.
65+
"developer_boundary_arn": "NOT_USED",
6466
},
6567
},
6668

@@ -128,7 +130,7 @@
128130
"team": "yaml:team",
129131
"region": "env:AWS_REGION",
130132
"aws_account_id": "env:AWS_ACCOUNT_ID",
131-
"permissions_boundary_arn": "ref:platform.developer_boundary_arn",
133+
"permissions_boundary_arn": f"expr:arn:aws:iam::${{env:AWS_ACCOUNT_ID}}:policy/{PROJECT}-developer-boundary",
132134
"trusted_services": "list:yaml:compute.trusted_service|default:ecs-tasks.amazonaws.com",
133135
"additional_policy_jsons": "collect:access_policy_json",
134136
},

terraform/modules/platform-data/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ data "aws_route53_zone" "main" {
6767
private_zone = false
6868
}
6969

70-
data "aws_iam_policy" "developer_boundary" {
71-
name = "${var.project}-developer-boundary"
72-
}
70+
71+
# Note: the developer boundary ARN is constructed directly by expand-modules.py
72+
# instead of using a data source, to avoid needing iam:GetPolicy permission.

terraform/org/boundary.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ resource "aws_iam_policy" "developer_boundary" {
1717
name = "${var.project}-developer-boundary"
1818
description = "Permission boundary for all non-platform roles. Self-replicating: roles with this boundary can only create roles that also carry it."
1919

20+
2021
policy = jsonencode({
2122
Version = "2012-10-17"
2223
Statement = [

0 commit comments

Comments
 (0)