From 2009ab73ebb5bbd657c966fcb901f771fafbada4 Mon Sep 17 00:00:00 2001 From: leandrom-humanforce Date: Mon, 17 Jul 2023 09:58:49 +1000 Subject: [PATCH] update --- src/.obsidian/workspace.json | 18 +++++++++--------- src/Cloud/AWS/Cognito.md | 29 +++++++++++++++++------------ src/Cloud/AWS/Moto.md | 8 ++++++++ 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/.obsidian/workspace.json b/src/.obsidian/workspace.json index e9e43f0a..0de0d8cc 100644 --- a/src/.obsidian/workspace.json +++ b/src/.obsidian/workspace.json @@ -85,7 +85,7 @@ "state": { "type": "markdown", "state": { - "file": "APIs/GitHub API.md", + "file": "Cloud/AWS/Cognito.md", "mode": "source", "source": false } @@ -170,7 +170,7 @@ "state": { "type": "backlink", "state": { - "file": "APIs/GitHub API.md", + "file": "Cloud/AWS/Cognito.md", "collapseAll": true, "extraContext": true, "sortOrder": "alphabetical", @@ -187,7 +187,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "APIs/GitHub API.md", + "file": "Cloud/AWS/Cognito.md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -210,7 +210,7 @@ "state": { "type": "outline", "state": { - "file": "APIs/GitHub API.md" + "file": "Cloud/AWS/Cognito.md" } } }, @@ -241,12 +241,13 @@ }, "active": "418ab84c808d127b", "lastOpenFiles": [ - "APIs/Google Calendar API.md", - "APIs/GitHub API.md", - "APIs", + "Cloud/AWS/Index.md", "Cloud/AWS/Moto.md", "Cloud/AWS/Cognito.md", - "Cloud/AWS/Index.md", + "Tools/Docker Desktop.md", + "APIs/GitHub API.md", + "APIs/Google Calendar API.md", + "APIs", "Cloud/Azure/Index.md", "Cloud/Azure", "Cloud/AWS", @@ -270,7 +271,6 @@ "Management/Hiring.md", "Management/Leadership.md", "Management/Management.md", - "Management/Metrics.md", "Frontend", "How-to/Git", "How-to/Powershell", diff --git a/src/Cloud/AWS/Cognito.md b/src/Cloud/AWS/Cognito.md index 93c20ed3..cc9c08ba 100644 --- a/src/Cloud/AWS/Cognito.md +++ b/src/Cloud/AWS/Cognito.md @@ -1,20 +1,25 @@ -``` -aws --endpoint-url=http://localhost:52007 cognito-idp create-user-pool --pool-name "localcloud" -aws --endpoint-url=http://localhost:52007 cognito-idp list-user-pools --max-results 20 -``` +**Tag: #Cognito** + +Execute `POST http://localhost:52009/moto-api/seed?a=42` to ensure the resulting state will always be the same. -Copy user pool id ``` -aws --endpoint-url=http://localhost:52007 cognito-idp create-user-pool-client --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --client-name msnotification --generate-secret -``` +aws --endpoint-url=http://localhost:52009 cognito-idp create-user-pool --pool-name "LocalDev" + +aws --endpoint-url=http://localhost:52009 cognito-idp create-user-pool-client --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --client-name msnotification --generate-secret -Copy Client Id +aws --endpoint-url=http://localhost:52009 cognito-idp admin-create-user --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --username "testuser" +aws --endpoint-url=http://localhost:52009 cognito-idp admin-set-user-password --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --username "testuser" --password "L0c4lD3v" --permanent + +aws --endpoint-url=http://localhost:52009 cognito-idp initiate-auth --auth-flow USER_PASSWORD_AUTH --auth-parameters USERNAME=testuser,PASSWORD=L0c4lD3v --client-id 71hfe86y5r215dew1zcyqesh0a --region ap-southeast-2 ``` -aws --endpoint-url=http://localhost:52007 cognito-idp admin-create-user --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --username "testuser" -aws --endpoint-url=http://localhost:52007 cognito-idp admin-set-user-password --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --username "testuser" --password "Hum4nF0rc3!" --permanent -aws --endpoint-url=http://localhost:52007 cognito-idp initiate-auth --auth-flow USER_PASSWORD_AUTH --auth-parameters USERNAME=testuser,PASSWORD=Hum4nF0rc3! --client-id {INSERT_NEW_CLIENTID} --region ap-southeast-2 -``` \ No newline at end of file +### Troubleshoot + +``` +aws --endpoint-url=http://localhost:52009 cognito-idp list-user-pools + +aws --endpoint-url=http://localhost:52009 cognito-idp list-user-pool-clients --user-pool-id ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5 +``` diff --git a/src/Cloud/AWS/Moto.md b/src/Cloud/AWS/Moto.md index 0d331d51..36496b72 100644 --- a/src/Cloud/AWS/Moto.md +++ b/src/Cloud/AWS/Moto.md @@ -1 +1,9 @@ [Recorder](https://docs.getmoto.org/en/latest/docs/configuration/recorder/index.html) +[Run using Docker](http://docs.getmoto.org/en/latest/docs/server_mode.html#run-using-docker) + +#Docker container: https://hub.docker.com/r/motoserver/moto + +`docker run -p 52009:3000 -e MOTO_COGNITO_IDP_USER_POOL_ID_STRATEGY=HASH -e MOTO_ENABLE_RECORDING=True motoserver/moto:latest` + + +#Cognito http://docs.getmoto.org/en/latest/docs/services/cognito-idp.html \ No newline at end of file