Apply gate: resolve team from GitHub API for team-based roles#95
Merged
Conversation
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)
The gate was using the old per-app role pattern (javabin-ci-app-{repo}).
Updated to resolve team via GitHub API and assume javabin-ci-team-{team},
matching the broker's team-based model.
- Extract GitHub App auth + team resolution to shared/github.py
- Update ci_broker and apply_gate to use shared module
- Add SSM read permission for GitHub App credentials to gate role
- Switch both Lambda archives to source{} blocks for shared inclusion
Terraform Plan🚧 Changes detected — Plan: 0 to add, 3 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟢 LOW Routine Lambda function updates with minor IAM permission additions for GitHub App credential access.
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 assumejavabin-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 moduleci_broker/handler.py: Usesshared.github.resolve_team()instead of inline copyapply_gate/handler.py: Usesshared.github.resolve_team()to find team, assumesjavabin-ci-team-{team}lambdas/main.tf: Added SSM read for GitHub App creds to gate role. Switched ci_broker + apply_gate archives tosource{}blocks to include shared module.registry.py+platform-data/main.tf: Construct boundary ARN instead of data sourceTest plan