【问题标题】:Setting Facebook API version in AWS Cognito User Pool using Terraform使用 Terraform 在 AWS Cognito 用户池中设置 Facebook API 版本
【发布时间】:2020-07-22 16:07:18
【问题描述】:

在集成 AWS Cognito 用户池时,我找不到任何有关如何在 Terraform 中设置 Facebook API 版本的文档。

下面的块可以毫无错误地部署:

resource "aws_cognito_identity_provider" "facebook_identity_provider" {
  provider_name = "Facebook"
  provider_type = "Facebook"
  user_pool_id  = aws_cognito_user_pool.global_user_pool.id

  provider_details  = {
    authorize_scopes = "email"
    client_id        = "<client-id>"
    client_secret    = "<client-secret>
  }
  attribute_mapping = {
    email    = "email"
    username = "id"
  }
}

但是在 AWS 控制面板中我看到了这个警告:

Facebook is going to deprecate Ver. 2.12 by May 1st, by which Cognito will remove our support for this API. We encourage you to select another version of API and check your attribute mappings.

最新版本是v6.0,如何设置?

【问题讨论】:

    标签: terraform amazon-cognito amazon-cognito-facebook


    【解决方案1】:

    经过反复试验,我发现可以在provider_details中使用api_version,如下所示:

    resource "aws_cognito_identity_provider" "facebook_identity_provider" {
      provider_name = "Facebook"
      provider_type = "Facebook"
      user_pool_id  = aws_cognito_user_pool.global_user_pool.id
    
      provider_details  = {
        api_version      = "v6.0"
        authorize_scopes = "email"
        client_id        = "<client-id>"
        client_secret    = "<client-secret>
      }
      attribute_mapping = {
        email    = "email"
        username = "id"
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2019-05-18
      • 2020-03-25
      • 1970-01-01
      • 2018-05-16
      • 2020-05-28
      • 2018-05-11
      • 2017-10-30
      • 2022-01-13
      相关资源
      最近更新 更多