Skip to content

Construct boundary ARN instead of data source lookup#94

Merged
Alexanderamiri merged 1 commit into
mainfrom
fix/construct-boundary-arn
Mar 18, 2026
Merged

Construct boundary ARN instead of data source lookup#94
Alexanderamiri merged 1 commit into
mainfrom
fix/construct-boundary-arn

Conversation

@Alexanderamiri
Copy link
Copy Markdown
Member

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

The boundary policy is tagged team=javabin (org default), not shared.
Instead of looking it up via iam:GetPolicy (which the cross-team deny
blocks), construct the deterministic ARN from the account ID and project.

- Remove data source from platform-data module
- Use expr:arn:aws:iam::${env:AWS_ACCOUNT_ID}:policy/... in registry
- Revert boundary.tf tags override (org default_tags are correct)
@Alexanderamiri Alexanderamiri requested a review from a team as a code owner March 18, 2026 00:08
@Alexanderamiri Alexanderamiri enabled auto-merge (squash) March 18, 2026 00:08
@github-actions
Copy link
Copy Markdown

Terraform Plan

No changes — infrastructure is up to date.

Plan output
Acquiring state lock. This may take a few moments...

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

@Alexanderamiri Alexanderamiri merged commit 6a02f85 into main Mar 18, 2026
3 checks passed
@Alexanderamiri Alexanderamiri deleted the fix/construct-boundary-arn branch March 18, 2026 00:09
Alexanderamiri added a commit that referenced this pull request Mar 18, 2026
## Summary
The apply gate Lambda used the old per-app role pattern
(`javabin-ci-app-{repo}`). Updated to resolve team from GitHub API (same
as the CI broker) and assume `javabin-ci-team-{team}`.

Also includes the boundary ARN construction fix from PR #94.

### Changes
- **`shared/github.py`**: Extracted GitHub App auth + team resolution
from ci_broker into shared module
- **`ci_broker/handler.py`**: Uses `shared.github.resolve_team()`
instead of inline copy
- **`apply_gate/handler.py`**: Uses `shared.github.resolve_team()` to
find team, assumes `javabin-ci-team-{team}`
- **`lambdas/main.tf`**: Added SSM read for GitHub App creds to gate
role. Switched ci_broker + apply_gate archives to `source{}` blocks to
include shared module.
- **`registry.py`** + **`platform-data/main.tf`**: Construct boundary
ARN instead of data source

## Test plan
- [ ] Merge, wait for apply (deploys updated Lambdas)
- [ ] Retrigger test app CI — apply gate should resolve team and assume
correct role
Alexanderamiri added a commit that referenced this pull request May 9, 2026
## 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
Alexanderamiri added a commit that referenced this pull request May 9, 2026
## Summary
The apply gate Lambda used the old per-app role pattern
(`javabin-ci-app-{repo}`). Updated to resolve team from GitHub API (same
as the CI broker) and assume `javabin-ci-team-{team}`.

Also includes the boundary ARN construction fix from PR #94.

### Changes
- **`shared/github.py`**: Extracted GitHub App auth + team resolution
from ci_broker into shared module
- **`ci_broker/handler.py`**: Uses `shared.github.resolve_team()`
instead of inline copy
- **`apply_gate/handler.py`**: Uses `shared.github.resolve_team()` to
find team, assumes `javabin-ci-team-{team}`
- **`lambdas/main.tf`**: Added SSM read for GitHub App creds to gate
role. Switched ci_broker + apply_gate archives to `source{}` blocks to
include shared module.
- **`registry.py`** + **`platform-data/main.tf`**: Construct boundary
ARN instead of data source

## Test plan
- [ ] Merge, wait for apply (deploys updated Lambdas)
- [ ] Retrigger test app CI — apply gate should resolve team and assume
correct role
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant