1
votes

I have a question regarding to AWS Cognito Identity Pool Setup in Terraform. So, i am trying to create identity pool, authentication provider as per the UI.(Screenshot below) AWS Identity Pool UI Creation Page

I was reading up on terraform or AWS docs and realise there is no example on how i could create Cognito Type Authentication Provider. I seen examples like Google or Facebook being shown in their docs and created as per code below. I assume this "supported_login_providers" is referring to authentication provider. But will like to ask for advice or help in how can i create a Cognito Based Authentication Provider?

    supported_login_providers = {
    "graph.facebook.com"  = "7346241598935552"
    "accounts.google.com" = "123456789012.apps.googleusercontent.com"
  }
1

1 Answers

1
votes

I use cognito_identity_providers to refer to a Cognito authentication provider:

cognito_identity_providers {
    client_id = aws_cognito_user_pool_client.my_user_pool.id
    provider_name = aws_cognito_user_pool.my_user_pool.endpoint
}

You should also create aws_cognito_user_pool_client, and aws_cognito_user_pool with your terraform script.