Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user-attribute-update-settings #72

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ for details and use-cases.

Default is `1`.

[**`attributes_require_verification_before_update`**](#var-attributes_require_verification_before_update): *(Optional `string`)*<a name="var-attributes_require_verification_before_update"></a>

A list of attributes requiring verification before update. If set, the provided value(s) must also be set in auto_verified_attributes. Valid values: email, phone_number. When you update the value of an email or phone number attribute, your user must verify the new value. Until they verify the new value, they can receive messages and sign in with the original value. If you don't turn on this feature, your user can't sign in with that attribute before they verify the new value.

Default is `["email"]`.

- [**`allow_software_mfa_token`**](#var-allow_software_mfa_token): *(Optional `bool`)*<a name="var-allow_software_mfa_token"></a>

Boolean whether to enable software token Multi-Factor Authentication (MFA) tokens, such as Time-Based One-Time Password (TOTP). To disable software token MFA when `sms_configuration` is not present, the `mfa_configuration` argument must be set to `OFF` and the `software_token_mfa_configuration` configuration block must be fully removed.
Expand Down
6 changes: 5 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ resource "aws_cognito_user_pool" "user_pool" {

mfa_configuration = var.mfa_configuration

user_attribute_update_settings {
attributes_require_verification_before_update = var.attributes_require_verification_before_update
}

password_policy {
minimum_length = var.password_minimum_length
require_lowercase = var.password_require_lowercase
Expand Down Expand Up @@ -211,7 +215,7 @@ locals {
}

resource "aws_cognito_user_pool_client" "client" {
for_each = var.module_enabled ? local.clients : {}
for_each = var.module_enabled ? local.clients : map(object({}))

name = each.key

Expand Down
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,14 @@ variable "auto_verified_attributes" {
]
}

variable "attributes_require_verification_before_update" {
type = set(string)
description = "(Required) A list of attributes requiring verification before update. If set, the provided value(s) must also be set in auto_verified_attributes. Valid values: email, phone_number."
default = [
"email"
]
}

variable "account_recovery_mechanisms" {
type = any
description = "(Optional) A list of recovery_mechanisms which are defined by a `name` and its `priority`. Valid values for `name` are veri fied_email, verified_phone_number, and admin_only."
Expand Down