How do i enable “cognito user pool” option in app client settings through terraform?

Question:

I am able to specify “Facebook” in the “supported_identity_providers” argument and it works. I tried specifying the name, id and the word “Cognito User Pool” for the supported identity providers argument and it keeps throwing validation error.

enter image description here

I want the option pointed by the arrow enabled from terraform. What value do I pass to the “supported_identity_providers” argument?

Answer:

Short answer

Details

The AWS API for creating a user pool client can be found here and the terraform docs here.

Both are missing the default names for the standard providers (Cognito, Amazon, Google, Facebook).

I wasn’t been able to find any amazon documentation on the default names of the user pool client’s SupportedIdentityProviders value, only a pattern in the AWS API docs here.

When writing the terraform code I had to toggle on the values in the AWS console, then use the CLI to retrieve the values:

aws cognito-idp describe-user-pool-client --user-pool-id <pool-id> --client-id <client-id>

For cognito this gives back COGNITO the social providers are Google, Facebook, and LoginWithAmazon. If you are using OIDC/SAML it is the provider name you have configured.

Leave a Reply