How to delete an inline policy of an IAM user

Below is the command to delete an inline policy from an IAM user where username is the name of the user and policyname is the name of the policy being deleted.

aws iam delete-user-policy --user-name username --policy-name policyname

See also  How to allocate a new Elastic IP and associate it to an EC2 Instance