Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Cognitoユーザープール用のリソースを作成する #6

Merged
merged 3 commits into from
Jun 4, 2020

Conversation

kobayashi-m42
Copy link
Member

@kobayashi-m42 kobayashi-m42 commented May 26, 2020

issueURL

#3

Doneの定義

  • Cognitoユーザープールが作成されていること

Issueではステージング用とローカル環境用の2種類を用意する想定であったが、現時点では2種類を用意する必要はないため1つだけ作成する。

変更点概要

技術的変更点概要

Cognito User Pool とアプリクライアントを作成。
Emailを必須項目とし、ユーザ名とパスワードでログインすることを想定している。

SESの設定は別のPRとする。

User Poolの下記の設定はTerraformでは対応していないため、一旦非推奨の設定になっている。
スクリーンショット 2020-06-03 23 54 58

terraform-provider-aws に Issueは作成されているが、いつ対応されるかは不明。
hashicorp/terraform-provider-aws#11220

下記のように local-exec を使用することで設定するか、もしくはこの設定だけ手動で設定するかを検討する必要がある。これについては課題を作成して、別途対応としたい。
https://stackoverflow.com/questions/59120055/set-account-recovery-preference-for-aws-cognito-user-pool-with-terraform

@kobayashi-m42 kobayashi-m42 self-assigned this May 31, 2020
@kobayashi-m42 kobayashi-m42 requested a review from keitakn June 3, 2020 15:02
generate_secret = false
prevent_user_existence_errors = "ENABLED"
refresh_token_validity = 30
explicit_auth_flows = ["ALLOW_ADMIN_USER_PASSWORD_AUTH", "ALLOW_REFRESH_TOKEN_AUTH"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API Gatewayで Cognito User Poolをオーソライザーとして設定することを想定している。
ドキュメントを読んでもこの設定でいいのかがわからなかったので、今後開発を進める中で変更するかもしれない。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

基本これで良いと思った🐱

ALLOW_ADMIN_USER_PASSWORD_AUTH

Next.jsはBFF層持てるし、基本的にこれで問題なさそうだなって思った🐱

ALLOW_REFRESH_TOKEN_AUTH

これはユーザーの再認証減らしたいから設定しておいて良さそう!

今後開発を進める中で変更するかもしれない。

そうだね!やってみて問題あれば変更で良さそうだね!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@keitakn keitakn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとう🐱!問題ないと思うから承認押しておくね!

アカウント回復の設定について

terraform-provider-aws に Issueは作成されているが、いつ対応されるかは不明。
hashicorp/terraform-provider-aws#11220

下記のように local-exec を使用することで設定するか、もしくはこの設定だけ手動で設定するかを検討する必要がある。これについては課題を作成して、別途対応としたい。
https://stackoverflow.com/questions/59120055/set-account-recovery-preference-for-aws-cognito-user-pool-with-terraform

issueはかなり前からOpenされてて対応されてないから、stackoverflowに載ってた方法を試してみて、ダメそうだったら手動で設定とかでも良いと思う! #7 作成しておいた🐱!

LGTM

@kobayashi-m42 kobayashi-m42 merged commit a9fa4f1 into master Jun 4, 2020
@keitakn keitakn deleted the feature/issue3 branch June 4, 2020 12:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants