Clone Scaleway IAM Policy
scaleway_iam_clone_policyClone an IAM policy while automatically restoring its original principal and tags to avoid orphaned policies.
Instructions
Clone an existing IAM Policy. The result is an exact copy: same rules, same principal (application_id/user_id/group_id), same tags. Name gets Scaleway's own 'Copy of ' default - rename afterward with scaleway_iam_update_policy if a distinct name is needed (nothing references a Policy by name, so renaming is always safe). Gotcha this tool works around: Scaleway's underlying CLONE endpoint (POST /policies/{id}/clone) ignores its request body entirely and always returns the clone UNATTACHED (no_principal, tags stripped) regardless of the source - confirmed empirically 2026-08-18. This tool follows up with a PATCH restoring the source's principal and tags before returning, so the clone you get back actually matches what 'clone' implies, instead of a silently orphaned policy with no built-in way to reattach it. As with scaleway_iam_create_policy, the response's nb_rules/nb_permission_sets counts can read 0 immediately after this call despite rules having copied correctly - call scaleway_iam_list_policy_rules for ground truth if that count looks wrong.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| policy_id | Yes |