Question:
Currently stuck in the mud with trying to to set up an ‘app client’ for an AWS Cognito User Pool through Terraform. Here is my resource as it stands:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
resource "aws_cognito_user_pool" "notes-pool" { name = "notes-pool" username_attributes = ["email"] verification_message_template { default_email_option = "CONFIRM_WITH_CODE" } password_policy { minimum_length = 10 require_lowercase = false require_numbers = true require_symbols = false require_uppercase = true } tags { "Name" = "notes-pool" "Environment" = "production" } } |
The above works just fine, and my user pool is created. If anybody has any ideas on how to create an app client in the same resource, I’m all ears. I’m beginning to suspect that this functionality doesn’t exist!
Answer:
I believe this was just added to the most recent verison of terraform. You could do something like the following to add a client to your user pool:
1 2 3 4 5 6 7 |
resource "aws_cognito_user_pool_client" "client" { name = "client" user_pool_id = "${aws_cognito_user_pool.pool.id}" generate_secret = true explicit_auth_flows = ["ADMIN_NO_SRP_AUTH"] } |
See here for the docs:Terraform entry on aws_cognito_user_pool_client