DeleteUserPolicy() public method

Deletes the specified inline policy that is embedded in the specified IAM user.

A user can also have managed policies attached to it. To detach a managed policy from a user, use DetachUserPolicy. For more information about policies, refer to Managed Policies and Inline Policies in the IAM User Guide.

/// The request was rejected because it attempted to create resources beyond the current /// AWS account limits. The error message describes the limit exceeded. /// /// The request was rejected because it referenced an entity that does not exist. The /// error message describes the entity. /// /// The request processing has failed because of an unknown error, exception or failure. ///
public DeleteUserPolicy ( DeleteUserPolicyRequest request ) : Amazon.IdentityManagement.Model.DeleteUserPolicyResponse
request Amazon.IdentityManagement.Model.DeleteUserPolicyRequest Container for the necessary parameters to execute the DeleteUserPolicy service method.
return Amazon.IdentityManagement.Model.DeleteUserPolicyResponse
示例#1
0
 public static void DeleteUserPoliciesForUser(AmazonIdentityManagementServiceClient client, string username)
 {
     ListUserPoliciesResponse response =
         client.ListUserPolicies(new ListUserPoliciesRequest() { UserName = username });
     foreach (string pName in response.PolicyNames)
     {
         client.DeleteUserPolicy(new DeleteUserPolicyRequest() { UserName = username, PolicyName = pName });
     }
 }