Set rules on a Scaleway IAM Policy
scaleway_iam_set_policy_rulesReplace all rules on an existing IAM policy atomically to add or remove permission sets safely. Requires confirm=true and avoids lockout from delete-and-recreate.
Instructions
Overwrite the COMPLETE rules array on an existing Policy in one atomic call - the safe way to add or remove a permission set on a live policy. Requires confirm=true. Prefer this over delete+recreate: deleting a policy that grants its own holder IAMPolicyManager revokes that permission the instant it's deleted, before a replacement can be created, which can lock the credential you're using out of IAM entirely. Distinct lockout mode: a successful replace that drops this server's IAM-management rule (IAMPolicyManager/IAMApplicationManager) cannot be undone through this server - the credential then cannot call this tool, or any other IAM policy/application tool, to fix itself. Call scaleway_iam_list_policy_rules first to get the current array before changing it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | Yes | The COMPLETE rules array to set - this REPLACES every existing rule on the policy, it does not merge or append. Call scaleway_iam_list_policy_rules first, add/remove/edit within that array, then pass the whole thing back here. This is the safe way to change a live policy's grants: unlike delete+recreate, there's no window where the policy (or the permissions it grants its own holder) doesn't exist. | |
| confirm | Yes | Must be explicitly true. This is a full-replace of live grants: omitting the rule that grants this server IAMPolicyManager/IAMApplicationManager permanently locks the credential out of IAM. | |
| policy_id | Yes |