Amazon AppStream 2.0: Delete user using Aws cli

1.5k Views Asked by At

I have a IAM user who has the privilege of

+AmazonS3FullAccess
+AdministratorAccess
+IAMUserChangePassword
+AmazonAppStreamFullAccess

I have two user in Appstream2

John Doe
Alec Stain

For Deleting those while I try in command line

aws appstream delete-user --user-name [\p{L}\h]+ --authentication-type SAML

it returns,

An error occurred (AccessDeniedException) when calling the DeleteUser operation:

same thing happens for regex part if I alter with [\p{L}]+ or [\p{L}\p{M}\p{S}\p{N}\p{P}]+

Why is this AccessDeniedException and How can I delete appstream2 users anyway?

[if you wonder my credentials might be wrong, the following comman works perfectly

aws s3api create-bucket --bucket test-bucket-989000007 --region us-east-1

response:

{
    "Location": "/test-bucket-989000007"
}

]

3

There are 3 best solutions below

1
Aleksei Chernenkov On

--user-name parameter must be an email address of the user. I think that you can not use regular expression in that parameter. The documentation for the appstream delete-user can be found here.

0
Enéas On

I saw that there are no clear answers to this topic anywhere.

Here is an example I used and it worked.

aws appstream delete-user --user-name user-email --authentication-type USERPOOL

0
Jonathan G. Romero Labarrera On

For user in USER Pool you must be use this:

aws appstream delete-user --user-name user[email]@domain.tdl --authentication-type USERPOOL

And for USER with AD or SAML use this:

aws appstream delete-user user[domain]@domain.tdl [\p{L}\h]+ --authentication-type SAML