Skip to main content

Assign a permission set

POST 

/permission-set-assignments

Grants one permission set to one user or group across one or more AWS accounts. This is the call that actually cuts IAM roles: a permission set on its own is inert, and it is the assignment that turns the definition into real access in a real account.

A 200 is an acceptance, not a durable creation. Everything this call does before responding is validate the request and write one database row per account with status: "PROVISIONING". All of the work that matters (assuming into the member account, creating the IAM role, attaching its policies, binding the role to the principal in the identity provider) happens afterwards, in the background, and its outcome is never reported back through this API. When that background work fails, Prism deletes the assignment row, so an id handed to you in a 200 can return 404 from GET /permission-set-assignments/{id} seconds later. Treat that 404 as "provisioning failed", not as "this never existed". Access is only real once the assignment reads status: "PROVISIONED".

The response describes only the first of the assignments it created. data.assignment is a single object (the first row written) even when you named ten accounts. The ids and account ids of the other nine are not recoverable from this response at all. If you need them, call GET /permission-set-assignments afterwards, filtered by permissionSetId and username, and correlate on accountId.

Accounts that already had this grant are skipped in silence. The 409 below fires only when every account you named was already assigned. Name five accounts of which three already have the grant and you get a 200, two new rows, and nothing anywhere in the body naming the three that were skipped.

Prefer granting to a group over granting to each of its members: a group assignment is one row that tracks the group's membership, while user assignments have to be created and deleted person by person.

Request​

Responses​

At least one assignment row was created and its provisioning has been started. Read the warnings above before treating this as done. In particular, this status does not mean any IAM role exists yet, and the assignment it names may not survive.