Deleting a Managed Policy Version

You can delete a policy version at any time if you no longer need it and if it is not set as the default one. For more information about how to find out which version is set as the default one, see Listing the Versions of a Managed Policy.

To delete the default policy version, you need to delete all the other versions of this managed policy and then delete the policy. For more information, see Deleting a Managed Policy.

Deleting a Managed Policy Version Using OSC CLI

See the DeletePolicyVersion command sample in the documentation of the EIM API.

Deleting a Managed Policy Version Using AWS CLI

To delete a policy version, use the delete-policy-version command following this syntax:

Request sample
$ aws iam delete-policy-version \
    --profile YOUR_PROFILE \
    --policy-arn arn:aws:iam::123456789012:policy/MY_POLICY \
    --version-id v2 \
    --endpoint https://eim.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • policy-arn: The OUTSCALE Resource Name (ORN) of the policy.

  • version-id: The ID of the policy version you want to delete.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The specified policy version is deleted.

Related Pages

Corresponding API Method

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.