Set rules on a Scaleway IAM Policy
scaleway_iam_set_policy_rulesAtomically overwrite all rules on an existing policy to add or remove permission sets safely. Never get locked out: list current rules first, then replace the entire array.
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. 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. 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. | |
| policy_id | Yes |