delete-policy¶
Deletes the specified managed policy.
Before you can delete a managed policy, you must first detach the policy from all users, groups, and roles that it is attached to. In addition, you must delete all the policy’s versions. The following steps describe the process for deleting a managed policy:
Detach the policy from all users, groups, and roles that the policy is attached to, using the DetachUserPolicy, DetachGroupPolicy, or DetachRolePolicy API operations.
Delete the policy (this automatically deletes the policy’s default version) using this API.
For information about managed policies, refer to Managed Policies and Inline Policies in the IAM User Guide.
Refer to AWS API Documentation.
Synopsis¶
delete-policy
--policy-arn <value>
Options¶
--policy-arn (string)
The Amazon Resource Name (ARN) of the IAM policy you want to delete.
For more information about ARNs, refer to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.
Refer to AWS help for descriptions of global parameters.
Examples¶
To delete an IAM policy
This example deletes the policy whose ARN is
arn:aws:iam::123456789012:policy/MySamplePolicy
aws iam delete-policy --policy-arn arn:aws:iam::123456789012:policy/MySamplePolicy
For more information, refer to Overview of IAM Policies in the Using IAM guide.
Output¶
None

