30

I have created a custom IAM policy, now I'm trying to rename it but I cannot find an option for it. The policy was not attached to anything yet. Is it possible to rename it or should I create a new policy with the correct name and delete the old one?

eze1981
  • 780
  • 1
  • 7
  • 19

2 Answers2

38

No, you cannot rename your custom policy. Only alternative:

  • Copy policy
  • Create a new policy with the new name and paste the policy
  • Delete the old policy

enter image description here

helloV
  • 50,176
  • 7
  • 137
  • 145
  • i wish we had a 'mark as deprecated' button on SO! this one, as shown in @cyrille's answer, is no longer valid: https://stackoverflow.com/a/67499413/4386191 – Zev Averbach Jun 26 '23 at 08:56
7

You can now do it using the AWS command line tool with the update-policy

aws organizations update-policy \
    --policy-id p-examplepolicyid111 \
    --name Renamed-Policy \
    --description "This description replaces the original."
cyrille
  • 2,616
  • 1
  • 10
  • 18
  • 4
    Finding to policy id wasn't obvious to me. So I used [get_policy](https://docs.aws.amazon.com/cli/latest/reference/iam/get-policy.html) first: `aws iam get-policy --policy-arn ` – Jan Nov 18 '21 at 10:36
  • 5
    This is about updating `organizations` policies, which are a completely different thing. The poster asked about `iam` policies – Kutzi May 10 '22 at 10:05