Delete Policy Versions¶
Note
You cannot delete a policy version that is set as the default (active) one.
Prerequisites¶
An IAM account with an active Storage Account Owner session credentials (or admin access).
An existing policy created with
ARN <POLICY_ARN>and at least two versions.
Procedure¶
Run the following command to delete a non-default policy version in your account.
aws iam delete-policy-version --policy-arn <POLICY_ARN> --version-id v1
Note
--version-idcorresponds to the version of the non-default policy version you want to delete, prefixed withv.To see existing versions of a given policy
ARN, refer to List Policy Versions.
Post-checks¶
Call the get-policy-version API. If the policy version is correctly deleted,
the call must return a NoSuchEntity error.
Note
Deleted versions cannot be recovered. If you delete a policy version
(for example v2) and create a policy version afterwards,
this new policy will have the version v3.
Note
Operations on policy versions using the UI are limited to listing.

