Terraform AWS Cognito 应用程序客户端

Ada*_*son 5 amazon-web-services amazon-cognito terraform devops

目前陷入困境,试图通过 Terraform 为 AWS Cognito 用户池设置“应用程序客户端”。这是我的资源:

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"
  }
}
Run Code Online (Sandbox Code Playgroud)

以上工作正常,我的用户池已创建。如果有人对如何在同一资源中创建应用程序客户端有任何想法,我会全力以赴。我开始怀疑这个功能不存在!

cyr*_*ram 6

我相信这只是添加到最新版本的 terraform 中。您可以执行以下操作以将客户端添加到您的用户池:

 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"]
 }
Run Code Online (Sandbox Code Playgroud)

有关文档,请参见此处:aws_cognito_user_pool_client 上的 Terraform 条目