forked from lgallard/terraform-aws-cognito-user-pool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
640 lines (541 loc) · 19.5 KB
/
variables.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
#
# aws_cognito_user_pool
#
variable "enabled" {
description = "Change to false to avoid deploying any resources"
type = bool
default = true
}
variable "user_pool_name" {
description = "The name of the user pool"
type = string
}
variable "email_verification_message" {
description = "A string representing the email verification message"
type = string
default = null
}
variable "email_verification_subject" {
description = "A string representing the email verification subject"
type = string
default = null
}
# username_configuration
variable "username_configuration" {
description = "The Username Configuration. Setting `case_sensitive` specifies whether username case sensitivity will be applied for all users in the user pool through Cognito APIs"
type = map(any)
default = {}
}
# admin_create_user_config
variable "admin_create_user_config" {
description = "The configuration for AdminCreateUser requests"
type = map(any)
default = {}
}
variable "admin_create_user_config_allow_admin_create_user_only" {
description = "Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app"
type = bool
default = true
}
variable "temporary_password_validity_days" {
description = "The user account expiration limit, in days, after which the account is no longer usable"
type = number
default = 7
}
variable "admin_create_user_config_email_message" {
description = "The message template for email messages. Must contain `{username}` and `{####}` placeholders, for username and temporary password, respectively"
type = string
default = "{username}, your verification code is `{####}`"
}
variable "admin_create_user_config_email_subject" {
description = "The subject line for email messages"
type = string
default = "Your verification code"
}
variable "admin_create_user_config_sms_message" {
description = "- The message template for SMS messages. Must contain `{username}` and `{####}` placeholders, for username and temporary password, respectively"
type = string
default = "Your username is {username} and temporary password is `{####}`"
}
variable "alias_attributes" {
description = "Attributes supported as an alias for this user pool. Possible values: phone_number, email, or preferred_username. Conflicts with `username_attributes`"
type = list(string)
default = null
}
variable "username_attributes" {
description = "Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up. Conflicts with `alias_attributes`"
type = list(string)
default = null
}
variable "deletion_protection" {
description = "When active, DeletionProtection prevents accidental deletion of your user pool. Before you can delete a user pool that you have protected against deletion, you must deactivate this feature. Valid values are `ACTIVE` and `INACTIVE`."
type = string
default = "INACTIVE"
}
variable "auto_verified_attributes" {
description = "The attributes to be auto-verified. Possible values: email, phone_number"
type = list(string)
default = []
}
# sms_configuration
variable "sms_configuration" {
description = "The SMS Configuration"
type = map(any)
default = {}
}
variable "sms_configuration_external_id" {
description = "The external ID used in IAM role trust relationships"
type = string
default = ""
}
variable "sms_configuration_sns_caller_arn" {
description = "The ARN of the Amazon SNS caller. This is usually the IAM role that you've given Cognito permission to assume"
type = string
default = ""
}
# device_configuration
variable "device_configuration" {
description = "The configuration for the user pool's device tracking"
type = map(any)
default = {}
}
variable "device_configuration_challenge_required_on_new_device" {
description = "Indicates whether a challenge is required on a new device. Only applicable to a new device"
type = bool
default = null
}
variable "device_configuration_device_only_remembered_on_user_prompt" {
description = "If true, a device is only remembered on user prompt"
type = bool
default = null
}
# email_configuration
variable "email_configuration" {
description = "The Email Configuration"
type = map(any)
default = {}
}
variable "email_configuration_configuration_set" {
description = "The name of the configuration set"
type = string
default = null
}
variable "email_configuration_reply_to_email_address" {
description = "The REPLY-TO email address"
type = string
default = ""
}
variable "email_configuration_source_arn" {
description = "The ARN of the email source"
type = string
default = ""
}
variable "email_configuration_email_sending_account" {
description = "Instruct Cognito to either use its built-in functional or Amazon SES to send out emails. Allowed values: `COGNITO_DEFAULT` or `DEVELOPER`"
type = string
default = "COGNITO_DEFAULT"
}
variable "email_configuration_from_email_address" {
description = "Sender’s email address or sender’s display name with their email address (e.g. `[email protected]`, `John Smith <[email protected]>` or `\"John Smith Ph.D.\" <[email protected]>)`. Escaped double quotes are required around display names that contain certain characters as specified in RFC 5322"
type = string
default = null
}
# lambda_config
variable "lambda_config" {
description = "A container for the AWS Lambda triggers associated with the user pool"
type = any
default = {}
}
variable "lambda_config_create_auth_challenge" {
description = "The ARN of the lambda creating an authentication challenge."
type = string
default = null
}
variable "lambda_config_custom_message" {
description = "A custom Message AWS Lambda trigger."
type = string
default = null
}
variable "lambda_config_define_auth_challenge" {
description = "Defines the authentication challenge."
type = string
default = null
}
variable "lambda_config_post_authentication" {
description = "A post-authentication AWS Lambda trigger"
type = string
default = null
}
variable "lambda_config_post_confirmation" {
description = "A post-confirmation AWS Lambda trigger"
type = string
default = null
}
variable "lambda_config_pre_authentication" {
description = "A pre-authentication AWS Lambda trigger"
type = string
default = null
}
variable "lambda_config_pre_sign_up" {
description = "A pre-registration AWS Lambda trigger"
type = string
default = null
}
variable "lambda_config_pre_token_generation" {
description = "(deprecated) Allow to customize identity token claims before token generation"
type = string
default = null
}
variable "lambda_config_pre_token_generation_config" {
description = "Allow to customize identity token claims before token generation"
type = any
default = {}
}
variable "lambda_config_user_migration" {
description = "The user migration Lambda config type"
type = string
default = null
}
variable "lambda_config_verify_auth_challenge_response" {
description = "Verifies the authentication challenge response"
type = string
default = null
}
variable "lambda_config_kms_key_id" {
description = "The Amazon Resource Name of Key Management Service Customer master keys. Amazon Cognito uses the key to encrypt codes and temporary passwords sent to CustomEmailSender and CustomSMSSender."
type = string
default = null
}
variable "lambda_config_custom_email_sender" {
description = "A custom email sender AWS Lambda trigger."
type = any
default = {}
}
variable "lambda_config_custom_sms_sender" {
description = "A custom SMS sender AWS Lambda trigger."
type = any
default = {}
}
variable "mfa_configuration" {
description = "Set to enable multi-factor authentication. Must be one of the following values (ON, OFF, OPTIONAL)"
type = string
default = "OFF"
}
# software_token_mfa_configuration
variable "software_token_mfa_configuration" {
description = "Configuration block for software token MFA (multifactor-auth). mfa_configuration must also be enabled for this to work"
type = map(any)
default = {}
}
variable "software_token_mfa_configuration_enabled" {
description = "If true, and if mfa_configuration is also enabled, multi-factor authentication by software TOTP generator will be enabled"
type = bool
default = false
}
# password_policy
variable "password_policy" {
description = "A container for information about the user pool password policy"
type = object({
minimum_length = number,
require_lowercase = bool,
require_numbers = bool,
require_symbols = bool,
require_uppercase = bool,
temporary_password_validity_days = number
})
default = null
}
variable "password_policy_minimum_length" {
description = "The minimum length of the password policy that you have set"
type = number
default = 8
}
variable "password_policy_require_lowercase" {
description = "Whether you have required users to use at least one lowercase letter in their password"
type = bool
default = true
}
variable "password_policy_require_numbers" {
description = "Whether you have required users to use at least one number in their password"
type = bool
default = true
}
variable "password_policy_require_symbols" {
description = "Whether you have required users to use at least one symbol in their password"
type = bool
default = true
}
variable "password_policy_require_uppercase" {
description = "Whether you have required users to use at least one uppercase letter in their password"
type = bool
default = true
}
variable "password_policy_temporary_password_validity_days" {
description = "The minimum length of the password policy that you have set"
type = number
default = 7
}
# schema
variable "schemas" {
description = "A container with the schema attributes of a user pool. Maximum of 50 attributes"
type = list(any)
default = []
}
variable "string_schemas" {
description = "A container with the string schema attributes of a user pool. Maximum of 50 attributes"
type = list(any)
default = []
}
variable "number_schemas" {
description = "A container with the number schema attributes of a user pool. Maximum of 50 attributes"
type = list(any)
default = []
}
# sms messages
variable "sms_authentication_message" {
description = "A string representing the SMS authentication message"
type = string
default = null
}
variable "sms_verification_message" {
description = "A string representing the SMS verification message"
type = string
default = null
}
# tags
variable "tags" {
description = "A mapping of tags to assign to the User Pool"
type = map(string)
default = {}
}
# user_attribute_update_settings
variable "user_attribute_update_settings" {
description = "Configuration block for user attribute update settings. Must contain key `attributes_require_verification_before_update` with list with only valid values of `email` and `phone_number`"
type = map(list(string))
default = null
}
# user_pool_add_ons
variable "user_pool_add_ons" {
description = "Configuration block for user pool add-ons to enable user pool advanced security mode features"
type = map(any)
default = {}
}
variable "user_pool_add_ons_advanced_security_mode" {
description = "The mode for advanced security, must be one of `OFF`, `AUDIT` or `ENFORCED`"
type = string
default = null
}
# verification_message_template
variable "verification_message_template" {
description = "The verification message templates configuration"
type = map(any)
default = {}
}
variable "verification_message_template_default_email_option" {
description = "The default email option. Must be either `CONFIRM_WITH_CODE` or `CONFIRM_WITH_LINK`. Defaults to `CONFIRM_WITH_CODE`"
type = string
default = null
}
variable "verification_message_template_email_message_by_link" {
description = "The email message template for sending a confirmation link to the user, it must contain the `{##Click Here##}` placeholder"
type = string
default = null
}
variable "verification_message_template_email_subject_by_link" {
description = "The subject line for the email message template for sending a confirmation link to the user"
type = string
default = null
}
#
# aws_cognito_user_pool_domain
#
variable "domain" {
description = "Cognito User Pool domain"
type = string
default = null
}
variable "domain_certificate_arn" {
description = "The ARN of an ISSUED ACM certificate in us-east-1 for a custom domain"
type = string
default = null
}
#
# aws_cognito_user_pool_client
#
variable "clients" {
description = "A container with the clients definitions"
type = any
default = []
}
variable "client_allowed_oauth_flows" {
description = "The name of the application client"
type = list(string)
default = []
}
variable "client_allowed_oauth_flows_user_pool_client" {
description = "Whether the client is allowed to follow the OAuth protocol when interacting with Cognito user pools"
type = bool
default = true
}
variable "client_allowed_oauth_scopes" {
description = "List of allowed OAuth scopes (phone, email, openid, profile, and aws.cognito.signin.user.admin)"
type = list(string)
default = []
}
variable "client_auth_session_validity" {
description = "Amazon Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. Valid values between 3 and 15. Default value is 3."
type = number
default = 3
}
variable "client_callback_urls" {
description = "List of allowed callback URLs for the identity providers"
type = list(string)
default = []
}
variable "client_default_redirect_uri" {
description = "The default redirect URI. Must be in the list of callback URLs"
type = string
default = ""
}
variable "client_enable_token_revocation" {
description = "Whether the client token can be revoked"
type = bool
default = true
}
variable "client_explicit_auth_flows" {
description = "List of authentication flows (ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH)"
type = list(string)
default = []
}
variable "client_generate_secret" {
description = "Should an application secret be generated"
type = bool
default = true
}
variable "client_logout_urls" {
description = "List of allowed logout URLs for the identity providers"
type = list(string)
default = []
}
variable "client_name" {
description = "The name of the application client"
type = string
default = null
}
variable "client_read_attributes" {
description = "List of user pool attributes the application client can read from"
type = list(string)
default = []
}
variable "client_prevent_user_existence_errors" {
description = "Choose which errors and responses are returned by Cognito APIs during authentication, account confirmation, and password recovery when the user does not exist in the user pool. When set to ENABLED and the user does not exist, authentication returns an error indicating either the username or password was incorrect, and account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to LEGACY, those APIs will return a UserNotFoundException exception if the user does not exist in the user pool."
type = string
default = null
}
variable "client_supported_identity_providers" {
description = "List of provider names for the identity providers that are supported on this client"
type = list(string)
default = []
}
variable "client_write_attributes" {
description = "List of user pool attributes the application client can write to"
type = list(string)
default = []
}
variable "client_access_token_validity" {
description = "Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. This value will be overridden if you have entered a value in `token_validity_units`."
type = number
default = 60
}
variable "client_id_token_validity" {
description = "Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. Must be between 5 minutes and 1 day. Cannot be greater than refresh token expiration. This value will be overridden if you have entered a value in `token_validity_units`."
type = number
default = 60
}
variable "client_refresh_token_validity" {
description = "The time limit in days refresh tokens are valid for. Must be between 60 minutes and 3650 days. This value will be overridden if you have entered a value in `token_validity_units`"
type = number
default = 30
}
variable "client_token_validity_units" {
description = "Configuration block for units in which the validity times are represented in. Valid values for the following arguments are: `seconds`, `minutes`, `hours` or `days`."
type = any
default = {
access_token = "minutes"
id_token = "minutes"
refresh_token = "days"
}
}
#
# aws_cognito_user_group
#
variable "user_groups" {
description = "A container with the user_groups definitions"
type = list(any)
default = []
}
variable "user_group_name" {
description = "The name of the user group"
type = string
default = null
}
variable "user_group_description" {
description = "The description of the user group"
type = string
default = null
}
variable "user_group_precedence" {
description = "The precedence of the user group"
type = number
default = null
}
variable "user_group_role_arn" {
description = "The ARN of the IAM role to be associated with the user group"
type = string
default = null
}
#
# aws_cognito_resource_server
#
variable "resource_servers" {
description = "A container with the user_groups definitions"
type = list(any)
default = []
}
variable "resource_server_name" {
description = "A name for the resource server"
type = string
default = null
}
variable "resource_server_identifier" {
description = "An identifier for the resource server"
type = string
default = null
}
variable "resource_server_scope_name" {
description = "The scope name"
type = string
default = null
}
variable "resource_server_scope_description" {
description = "The scope description"
type = string
default = null
}
#
# Account Recovery Setting
#
variable "recovery_mechanisms" {
description = "The list of Account Recovery Options"
type = list(any)
default = []
}
#
# aws_cognito_identity_provider
#
variable "identity_providers" {
description = "Cognito Pool Identity Providers"
type = list(any)
default = []
sensitive = true
}