Repository navigation
fix(team-provisioner): grant new teams AWS access, report missing IC users - #180
Conversation
…users - Platform CI queues a new sync_team_access action after every apply, so a newly registered team gets its permission set and account assignment once its guardrails policy exists, without a manual re-run. - Members without an Identity Center user are returned in not_in_identity_center, no longer counted in member_count, and listed in the Slack summary with the Google Admin fix. - GitHub team members without a role: default to maintainer, matching the docs, so the registrant can add repos to the team. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terraform Plan🚧 Changes detected — Plan: 0 to add, 1 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟢 LOW Plan updates one existing Lambda function (javabin-team-provisioner) in place with a new deployment package (source_code_hash change); no resources created or destroyed.
|
…is new CreateAccountAssignment accepts an assignment that already exists without a ConflictException, so already_existed was never set and sync_team_access posted "Team Provisioning Complete" for every team on every platform apply. Look the assignment up with ListAccountAssignments first: skip the create when it exists, mark already_existed False only when confirmed new, and stay quiet when the lookup fails. Tests now mock the SSO client instead of _ensure_team_permission_set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review follow-up (d5137c3): Accepted: Changes:
Verified with Rejected: none. |
Terraform Plan🚧 Changes detected — Plan: 0 to add, 2 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟢 LOW Plan updates two existing resources in place (0 added, 0 destroyed): the team provisioner Lambda's IAM role policy gains sso:ListAccountAssignments, and the Lambda code is redeployed with a new source hash.
|
… of javabin-developer@ Google's SCIM provisioning creates Identity Center users only for direct members of drift@, styret@ and javabin-developer@java.no; it does not expand nested groups. javabin-developer@ had one member, so team members (e.g. hakon.vadstein, javazoneweb) and most of kodesmia never got a user and the provisioner skipped them. - Team sync: every member's java.no address becomes a direct MEMBER of AWS_ACCESS_GROUP (default javabin-developer@java.no, var.aws_access_group). Additive only; reports added members, members not in kodesmia or a team (preserved) and personal addresses (skipped). - Access groups with `flatten: true` in the registry's access.yaml get the role groups' individual members instead of the nested group email. Additive, same reporting. - New sync_access_members action, run by EventBridge every 3 hours: adds recorded team members to the access group and puts recorded members whose Identity Center user SCIM has since created into their team-<name> / kodesmia groups. Slack only when someone was added or an add failed. - The not-in-Identity-Center report now says why: pending SCIM (just added to javabin-developer@ or already in a provisioned group) or can't be provisioned (personal address, suspended, not in Google). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Team and kodesmia members now get AWS access (017185b)Why. Google's SCIM provisioning creates Identity Center users only for direct members of Change
Live dry run (read-only)I imported the handler locally with the provisioner's own credentials ( Would add to
kodesmia and team members not in Identity Center today (12). All are classified The other 10 already have an Identity Center user through drift@ or styret@. Adding them to Scheduled retry today: no Identity Center writes. Everyone missing is still waiting for a user: the 12 above in Verification
Docs
Not done here (outside this worktree)
🤖 Generated with Claude Code |
Terraform Plan🚧 Changes detected — Plan: 3 to add, 2 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟢 LOW Plan adds an EventBridge schedule (every 3 hours) that invokes the team-provisioner Lambda to retry Identity Center group memberships, plus a Lambda permission for it, and updates the Lambda code, its environment, and its IAM policy; 0 destroys.
|
Resolve conflicts with #180 (team access sync) and the ECS exec change: keep the boundary-based team permission set and scoped inline policy, keep main's SCIM/access-group docs and sync_team_access, and describe sync_team_access as switching pending teams from read-only to full access. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Three findings from the developer-experience audit, all in the team provisioner:
_ensure_team_permission_setstops before the inline policy and the account assignment whilejavabin-team-<team>-guardrailsdoesn't exist yet. Platform CI only creates that policy when it applies on the registry'steams-changeddispatch, which runs after the provisioner, and nothing ran the provisioner again. Registry run 40515556958 (javazoneweb) ended at"guardrails": "pending: policy not created yet". The assignment only appeared after someone ran the provisioner by hand on 29 Oct.member_count. I checked this live:hakon.vadstein@java.no(javazoneweb) has no user in identity stored-9967444724. That store has 24 users, allCreatedBy: SCIM/..., and the newest was created on 2026-05-27.member.javabin register-teamnever writesrole:, but the getting-started doc and the registry README say members become maintainers. Adding a repo to a team needs a maintainer.Change
sync_team_accessaction. Platform CI queues it after every apply (scripts/sync-team-access.sh, async and non-blocking, in the same style asreconcile-app-auth.sh).team-*Identity Center group whose guardrails policy exists and is tagged as made by platform Terraform. For each one it attaches the guardrails, writes the inline policy, makes the account assignment and re-provisions the permission set.platform) are left untouched, and the permission set is not even created for them.javabin-ci-infracan invoke Lambdas, and the provisioner role already has the SSO, identitystore and IAM read permissions.not_in_identity_center: [emails].member_countcounts only members who are actually in the group, and the log line is now WARNING.docs/lambda-functions.md:identitystore:CreateUserhas no link to the Google account, so suspending the person in Google would not remove their AWS access.UserNamewould conflict with that user and fail.role:now default to GitHubmaintainer(GITHUB_DEFAULT_TEAM_ROLE);role: memberopts someone out. An invalid role still falls back tomember. The Google group keepsMEMBERas its default. Existing members withoutrole:will be promoted on their team's next registry sync.docs/lambda-functions.md(new GitHub-team and team-AWS-access sections, corrected trigger),docs/ci-workflow.md(post-apply steps, apply triggers),CLAUDE.md(scripts table, alert routing) and thelambdas/main.tfcomment.Verification
python3 -m unittest discover -s terraform/lambda-src/tests: 232 tests OK. The newtest_team_provisioner_access.pycovers:teamsfilternot_in_identity_centerin both sync paths, the Slack summary block and the pending linepython3 -m unittest discover -s scripts/tests: 133 tests OK.terraform fmt -check -recursive terraform/platformandterraform validateboth pass.team-{cupcake,javazoneweb,jzwatch,platform,testteam}plus org groups.SCIM/...-created.Follow-ups (not in this PR)
registry/README.md(which says both "all members are maintainers" and "default: member") anddocs/getting-started.mdare in other repos and handled separately.🤖 Generated with Claude Code