Deleting a Managed Policy

You can delete a managed policy at any time if you no longer need it to control access to your resources.

This action removes the policy from your account. To remove the policy from the users or groups to which it is applied only without deleting it, see Detaching a Managed Policy from a User or a Group.

Deleting a Managed Policy Using Cockpit v2

Before you begin:

  1. In the EIM Policies dashboard, check the box of the policy you want to delete.
    The policy is selected.

  2. Click IconTerminate Delete.
    A confirmation dialog box appears.

  3. Click Delete.
    The policy is deleted.

Deleting a Managed Policy Using OSC CLI

The DeletePolicy command deletes a managed policy.
Before deleting a managed policy, you must unlink all users linked to it and delete all the versions of the policy, except the default one, using the DeletePolicyVersion method.

Request sample
$ osc-cli api DeletePolicy --profile "default" \
    --PolicyOrn "orn:ows:idauth::012345678910:policy/example/example-user-policy"

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

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • PolicyOrn: The OUTSCALE Resource Name (ORN) of the policy you want to delete. For more information, see Resource Identifiers.

The DeletePolicy command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Deleting a Managed Policy Using oapi-cli

The DeletePolicy command deletes a managed policy.
Before deleting a managed policy, you must unlink all users linked to it and delete all the versions of the policy, except the default one, using the DeletePolicyVersion method.

Request sample
$ oapi-cli --profile "default" DeletePolicy \
    --PolicyOrn "orn:ows:idauth::012345678910:policy/example/example-user-policy"

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

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • PolicyOrn: The OUTSCALE Resource Name (ORN) of the policy you want to delete. For more information, see Resource Identifiers.

The DeletePolicy command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Deleting a Managed Policy Using AWS CLI

Before you begin:

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

Request sample
$ aws iam delete-policy \
    --profile YOUR_PROFILE \
    --policy-arn arn:aws:iam::123456789012:policy/MY_POLICY \
    --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 you want to delete.

  • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

The specified managed policy 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.