-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcognito-poc.tf
66 lines (54 loc) · 1.46 KB
/
cognito-poc.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
resource "aws_cognito_user_pool" "yourpoll-poc" {
# This is choosen when creating a user pool in the console
name = "yourpoll-poc"
# ATTRIBUTES
admin_create_user_config {
allow_admin_create_user_only = "false"
}
username_configuration {
case_sensitive = false
}
schema {
attribute_data_type = "String"
mutable = false
name = "email"
required = true
string_attribute_constraints {
min_length = 0
max_length = 2048
}
}
# POLICY
password_policy {
minimum_length = "6"
require_lowercase = false
require_numbers = false
require_symbols = false
require_uppercase = false
temporary_password_validity_days = "7"
}
# MFA & VERIFICATIONS
mfa_configuration = "OFF"
auto_verified_attributes = ["email"]
# MESSAGE CUSTOMIZATIONS
verification_message_template {
default_email_option = "CONFIRM_WITH_CODE"
email_message = "Your verification code is {####}"
email_subject = "Your verification code"
}
email_configuration {
email_sending_account = "COGNITO_DEFAULT"
reply_to_email_address = "[email protected]"
}
# TAGS
tags = {
project = "No Meat May"
}
}
resource "aws_cognito_user_pool_client" "yourpoll-poc" {
name = "yourpoll-poc"
user_pool_id = aws_cognito_user_pool.yourpoll-poc.id
generate_secret = false
prevent_user_existence_errors = "ENABLED"
explicit_auth_flows = ["ADMIN_NO_SRP_AUTH"]
}