Last active
July 12, 2022 03:45
-
-
Save sonufrienko/ba724061be7163acbdca6a705017ddba to your computer and use it in GitHub Desktop.
Useful AWS CLI commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export AWS_COGNITO_REGION= | |
export AWS_COGNITO_USERPOOL_ID= | |
export AWS_COGNITO_CLIENT_ID= | |
export AWS_COGNITO_USERNAME= | |
export AWS_COGNITO_PASSWORD=" | |
# Cognito change password | |
aws cognito-idp respond-to-auth-challenge \ | |
--region $AWS_COGNITO_REGION \ | |
--client-id $AWS_COGNITO_CLIENT_ID \ | |
--challenge-name NEW_PASSWORD_REQUIRED \ | |
--challenge-responses NEW_PASSWORD=$AWS_COGNITO_PASSWORD,USERNAME=$AWS_COGNITO_USERNAME \ | |
--session XXX | |
# Sets the specified user's password in a user pool as an administrator | |
aws cognito-idp admin-set-user-password \ | |
--user-pool-id $AWS_COGNITO_USERPOOL_ID \ | |
--region $AWS_COGNITO_REGION \ | |
--username $AWS_COGNITO_USERNAME \ | |
--password $AWS_COGNITO_PASSWORD \ | |
--permanent | |
# Login with username/password | |
aws cognito-idp initiate-auth \ | |
--region $AWS_COGNITO_REGION \ | |
--client-id $AWS_COGNITO_CLIENT_ID \ | |
--auth-flow USER_PASSWORD_AUTH \ | |
--auth-parameters USERNAME=$AWS_COGNITO_USERNAME,PASSWORD=$AWS_COGNITO_PASSWORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment