You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The same class of bug has now bitten three times: in-instance/out-of-band code (spored, ttl-reaper) calls an AWS API that the relevant IAM role/policy does not grant, so the call fails with AccessDenied — and because these paths are best-effort and under-logged, it manifests as a silent no-op, not a loud failure.
The IAM policy (pkg/aws/iam.gobuildInlinePolicy for spored; lambda/ttl-reaper/template.yaml for the reaper) is maintained by hand, separately from the code that makes the calls. Adding an SDK call doesn't fail any build/test if the matching grant is missing — it only fails at runtime, in an account, often silently.
Ideas (pick one or more)
A test that greps the agent/reaper packages for client.<Service> SDK call sites and asserts each service appears in the inline policy (a coarse but cheap drift guard — would have caught all three).
Centralize the spored required-action list in one place that both buildInlinePolicy and a doc/test consume, so adding a call forces a policy edit in the same change.
Pattern
The same class of bug has now bitten three times: in-instance/out-of-band code (spored, ttl-reaper) calls an AWS API that the relevant IAM role/policy does not grant, so the call fails with AccessDenied — and because these paths are best-effort and under-logged, it manifests as a silent no-op, not a loud failure.
Confirmed instances:
fsx:*but the cross-account role granted EC2 only (silent per-region AccessDenied, masked by dry-run).fsx:DescribeFileSystems/fsx:CreateDataRepositoryAssociationbut the spored inline policy had nofsx:*(silent no-op; also a startup race).lambda:InvokeFunctionUrlon the dns-updater fn (added in the cutover).Why it keeps happening
The IAM policy (
pkg/aws/iam.gobuildInlinePolicyfor spored;lambda/ttl-reaper/template.yamlfor the reaper) is maintained by hand, separately from the code that makes the calls. Adding an SDK call doesn't fail any build/test if the matching grant is missing — it only fails at runtime, in an account, often silently.Ideas (pick one or more)
client.<Service>SDK call sites and asserts each service appears in the inline policy (a coarse but cheap drift guard — would have caught all three).buildInlinePolicyand a doc/test consume, so adding a call forces a policy edit in the same change.spawn doctor-style IAM self-check that dry-run/simulates the spored role against its required actions.Low-glamour, high-leverage: each occurrence has cost a live debugging session. Filing so the next FSx/DNS/whatever feature doesn't rediscover it.