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
{{ message }}
Repository navigation
Detached sweeps with --iam-role/--iam-policy/--instance-profile: the orchestrator cannot pass the profile, every member is refused #1331
Found while doing #1323. A detached sweep whose members use a custom instance profile is refused at RunInstances for every member. This was already true before #1323 and still is after it.
Evidence (code trace, not run on AWS)
applyCLIIAMToSweep (cmd/launch_sweep.go) handles --iam-role / --iam-policy / --iam-policy-file / --iam-managed-policies / --s3-read / --s3-write: it creates a spawn-instance-<hash> role and profile (pkg/aws/iam.gogenerateRoleName) and writes it to defaults.iam_role. --instance-profile X and a row's own iam_role: are passed through as given.
So for any other profile EC2 refuses with an authorization error. isCapacityError does not match that error, so the member fails immediately and the sweep records it as a failed row. The foreground path has no such limit, because it launches with the user's own credentials.
Options
Widen the grant to role/spawn-instance-*, which only spawn creates (its roles are tagged spawn:managed=true). Keep the EC2 condition and add an iam:ResourceTag-style condition if IAM supports one for PassRole; verify it with a real PutRolePolicy plus simulate allow/deny before relying on it.
And/or have the CLI refuse, before upload, a detached sweep whose profile the orchestrator cannot pass. Point the user at --no-detach, which works today, instead of a sweep where every member fails.
An arbitrary user-named --instance-profile cannot be covered by a scoped grant. It should get the refusal.
Activity
fix(sweep): give detached members their tags, passable profiles and r…