We found a pile of notes on the desk of the UnicornGames Solutions Architect. On the top of these notes is a post-it note that says “Use the AWS CLI to make yourself an application administrator”. When we looked further, we saw that these notes contained steps about how to make yourself an administrator in Cognito.
Let’s try to follow these steps…
Find your Amazon Cognito User Pool ID:
For this workshop, we recommend using Cloud9 to access the AWS CLI; however, you can also perform these tasks from a terminal in your personal computer with AWS CLI credentials properly configured for administrator access.
Using the AWS CLI inside of your AWS Cloud9 terminal, add your Alien Attack user to the Cognito Managers group:
Run the following command to add your user to the Cognito group Managers. Replace the values <user-pool-id>, <username-that-you-used-to-register> and <region> with the correct information from your environment. This command will give you access to the Scoreboard Manager resources.
aws cognito-idp admin-add-user-to-group --user-pool-id <user-pool-id> --username <username-that-you-used-to-register> --group-name Managers --region <region>
Visit the Manager Console tab in your browser, refresh the page, and attempt to access this page again. It looks like we are getting a different error now. Are you seeing a ParameterNotFound: null error? If so, let’s proceed to the next step to solve it.
There is another way to solve this directly in the AWS Management Console:
Note: This fix worked, but ideally we would not want to have to add administrators to a newly deployed environment manually (either from the AWS CLI or from the Console). Is there a way that we can automatically deploy new environments with an administrator user? Let’s keep thinking about this problem, we might need to implement this functionality in a future step.