AWS Cognito SMS Role : Cannot create or assign a n

2020-07-17 08:28发布

问题:

I am not able to get verification codes(sms) and mobile app. i deleted the role. i tried recreating the role in cognito but it doesn't give any option to do so.

Error response while i create new user : "Role does not have trust relationship allowing cognito to assume the role"

On saving the verification settings on my cognito (with the previous role arn stuck in there) it say "Your roles are still being created"

Error while saving verification changes

回答1:

I too faced the same issue. Let me share the method in which i solved it, Although not the optimal method, i think, but i hope it helps:

1) I had another cognito userpool, in which i hadn't created the sms role and under that userpool i created the SMS role with same name as the name of the SMS role i deleted(Just to let aws create the roles and policy by itself, and because i am lazy ;-)).

2) Under the newly created SMS Role's trust relationship condition, i substituted the externalID with my main userpool's externalID.

You can get the externalID using aws cli.

aws cognito-idp describe-user-pool --user-pool-id <user-pool-id>

Or you can create SMS service role with the same name and attach SNS write policy with it and create trust relationship with your cognito userpool, to let it assume the role.

Hope it helps. Cheers.