Terraform resource: aws cognito user pool

From wikieduonline
(Redirected from Aws cognito user pool)
Jump to navigation Jump to search

aws_cognito_user_pool (tf.io)

Official examples[edit]

Basic[edit]

resource "aws_cognito_user_pool" "pool" {
 name = "mypool"
}

Enabling SMS and Software Token Multi-Factor Authentication[edit]

resource "aws_cognito_user_pool" "example" {
  # ... other configuration ...

  mfa_configuration          = "ON"
  sms_authentication_message = "Your code is {####}"

  sms_configuration {
    external_id    = "example"
    sns_caller_arn = aws_iam_role.example.arn
    sns_region     = "us-east-1"
  }

  software_token_mfa_configuration {
    enabled = true
  }
}

Using Account Recovery Setting[edit]

resource "aws_cognito_user_pool" "test" {
 name = "mypool"

 account_recovery_setting {
   recovery_mechanism {
     name     = "verified_email"
     priority = 1
   }
   recovery_mechanism {
     name     = "verified_phone_number"
     priority = 2
   }
 }
}

Related[edit]

See also[edit]

Advertising: