Fix budget IAM permissions and remove CloudTrail from monitoring#16
Merged
Merged
Conversation
Member
Alexanderamiri
commented
Mar 8, 2026
- Fix budgets IAM: use ViewBudget/ModifyBudget (AWS renamed the API actions)
- CloudTrail resources removed from state in previous PR, this removes them from code
The trail and S3 bucket are in terraform/org/cloudtrail.tf (human-applied). CI role's permission boundary blocks cloudtrail:DeleteTrail, causing apply failures.
Terraform PlanChanges detected — review required. Plan output |
LLM Plan ReviewRisk: 🟢 LOW Routine IAM policy update for team provisioner Lambda function to modify AWS Budgets API permissions.
|
4 tasks
Alexanderamiri
added a commit
that referenced
this pull request
Mar 17, 2026
## Summary
Root cause fix for the CODEOWNER self-merge regression.
The provisioner was calling `PUT /teams/{slug}/memberships/{user}` on
every run for every member, even when the role was already correct. This
re-added members via the API, changing their membership state from
"org-owner implicit" to "explicit API-added", which caused GitHub to
block self-merge on CODEOWNER-required PRs.
Now fetches current member roles first and only calls PUT when a role
change is actually needed.
## What happened
1. PR #80 changed provisioner to default `role: member`
2. Registry #16 merged → provisioner ran for first time with new code
3. Provisioner called `PUT memberships/alexanderamiri {"role":
"maintainer"}` — role was already maintainer, but the API call changed
the membership source
4. GitHub stopped allowing self-merge on CODEOWNER PRs
## Also reverted
Removed the org-admin bypass actor from the ruleset (was a band-aid, not
the fix).
## Test plan
- [ ] Merge this PR (should be self-mergeable — provisioner hasn't run
again)
- [ ] Trigger provisioner via registry merge
- [ ] Verify team membership unchanged (check GitHub API)
- [ ] Create a test PR → verify self-merge still works
Alexanderamiri
added a commit
that referenced
this pull request
May 9, 2026
- Fix budgets IAM: use ViewBudget/ModifyBudget (AWS renamed the API actions) - CloudTrail resources removed from state in previous PR, this removes them from code
Alexanderamiri
added a commit
that referenced
this pull request
May 9, 2026
## Summary
Root cause fix for the CODEOWNER self-merge regression.
The provisioner was calling `PUT /teams/{slug}/memberships/{user}` on
every run for every member, even when the role was already correct. This
re-added members via the API, changing their membership state from
"org-owner implicit" to "explicit API-added", which caused GitHub to
block self-merge on CODEOWNER-required PRs.
Now fetches current member roles first and only calls PUT when a role
change is actually needed.
## What happened
1. PR #80 changed provisioner to default `role: member`
2. Registry #16 merged → provisioner ran for first time with new code
3. Provisioner called `PUT memberships/alexanderamiri {"role":
"maintainer"}` — role was already maintainer, but the API call changed
the membership source
4. GitHub stopped allowing self-merge on CODEOWNER PRs
## Also reverted
Removed the org-admin bypass actor from the ruleset (was a band-aid, not
the fix).
## Test plan
- [ ] Merge this PR (should be self-mergeable — provisioner hasn't run
again)
- [ ] Trigger provisioner via registry merge
- [ ] Verify team membership unchanged (check GitHub API)
- [ ] Create a test PR → verify self-merge still works
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.