Index
terraform-aws-arc-cognito-userpool¶
Overview¶
SourceFuse AWS Reference Architecture (ARC) Terraform module for managing the cognito userpool module.
Features¶
- Complete Cognito User Pool Management: Create and configure user pools with all available settings.
- Security Best Practices: Built-in security configurations following AWS recommendations.
- Flexible Client Configuration: Support for multiple app clients with different configurations.
- Identity Provider Integration: Support for SAML, OIDC, and social identity providers.
- Advanced Security Features: MFA, advanced security mode, adaptive authentication.
- Lambda Triggers: Support for all Cognito Lambda triggers.
- Custom Domains: Support for custom domains with SSL certificates.
- User Pool Groups: Role-based access control with user groups.
- Resource Servers: OAuth 2.0 resource server configuration.
## Usage To see a full example, check out the main.tf file in the example folder.
Requirements¶
Name | Version |
---|---|
terraform | >= 1.6.0 |
aws | >= 5.0, < 7.0 |
Providers¶
Name | Version |
---|---|
aws | 6.12.0 |
Modules¶
Name | Source | Version |
---|---|---|
s3 | sourcefuse/arc-s3/aws | 0.0.5 |
Resources¶
Name | Type |
---|---|
aws_cloudwatch_log_group.this | resource |
aws_cloudwatch_log_resource_policy.cognito | resource |
aws_cognito_identity_provider.this | resource |
aws_cognito_log_delivery_configuration.this | resource |
aws_cognito_resource_server.this | resource |
aws_cognito_risk_configuration.this | resource |
aws_cognito_user.users | resource |
aws_cognito_user_group.this | resource |
aws_cognito_user_in_group.this | resource |
aws_cognito_user_pool.this | resource |
aws_cognito_user_pool_client.hosted_ui | resource |
aws_cognito_user_pool_client.this | resource |
aws_cognito_user_pool_domain.hosted_ui | resource |
aws_cognito_user_pool_domain.this | resource |
aws_cognito_user_pool_ui_customization.hosted_ui | resource |
aws_wafv2_web_acl_association.cognito_waf | resource |
aws_region.current | data source |
Inputs¶
Name | Description | Type | Default | Required |
---|---|---|---|---|
account_recovery_mechanisms | List of account recovery mechanisms | list(object({ |
[ |
no |
account_takeover_risk_configuration | n/a | object({ |
null |
no |
admin_create_user_config | Configuration for creating a new user profile | object({ |
{} |
no |
alias_attributes | Attributes supported as an alias for this user pool. Valid values: phone_number, email, or preferred_username | list(string) |
[] |
no |
auto_verified_attributes | Attributes to be auto-verified. Valid values: email, phone_number | list(string) |
[] |
no |
cognito_log_delivery_config | ============================================================================== VARIABLES - LOG STREAMING ============================================================================== | object({ |
null |
no |
compromised_credentials_risk_configuration | n/a | object({ |
null |
no |
create_resource_servers | Whether to create resource servers | bool |
false |
no |
create_user_pool_clients | Whether to create user pool clients | bool |
true |
no |
create_user_pool_domain | Whether to create user pool domain | bool |
false |
no |
create_user_pool_groups | Whether to create user pool groups | bool |
false |
no |
create_user_pool_users | Whether to create user pool users | bool |
false |
no |
deletion_protection | When active, DeletionProtection prevents accidental deletion of your user pool | string |
"INACTIVE" |
no |
device_configuration | Configuration for the user pool's device tracking | object({ |
null |
no |
email_configuration | Configuration for email settings | object({ |
{} |
no |
email_verification_message | String representing the email verification message | string |
null |
no |
email_verification_subject | String representing the email verification subject | string |
null |
no |
hosted_ui_config | Cognito Hosted UI configuration | object({ |
null |
no |
identity_providers_config | Configuration for optional identity providers | object({ |
{} |
no |
lambda_config | Configuration for AWS Lambda triggers associated with the user pool | object({ |
null |
no |
mfa_configuration | Multi-Factor Authentication (MFA) configuration for the User Pool. Set to null to omit. | string |
null |
no |
name | Name of the Cognito User Pool | string |
n/a | yes |
password_policy | Configuration for the user pool password policy | object({ |
{} |
no |
resource_servers | List of resource servers to create | list(object({ |
[] |
no |
risk_exception_configuration | n/a | object({ |
null |
no |
schema | Configuration for the schema attributes of a user pool | list(object({ |
[] |
no |
sms_authentication_message | String representing the SMS authentication message | string |
null |
no |
sms_configuration | Configuration for SMS settings | object({ |
null |
no |
sms_verification_message | String representing the SMS verification message | string |
null |
no |
software_token_mfa_configuration | Configuration for software token Multi-Factor Authentication (MFA) settings. Set to null to omit. | object({ |
null |
no |
tags | A map of tags to assign to the resources | map(string) |
{} |
no |
user_attribute_update_settings | Configuration for user attribute update settings | object({ |
null |
no |
user_group_memberships | List of user-to-group memberships | list(object({ |
[] |
no |
user_pool_add_ons | Advanced security configuration for Cognito User Pool. - advanced_security_mode: OFF | AUDIT | ENFORCED - advanced_security_additional_flows: (optional) block for custom flows - custom_auth_mode: e.g. "AUDIT" or "ENFORCED" |
object({ |
null |
no |
user_pool_clients | List of user pool clients to create | list(object({ |
[] |
no |
user_pool_domain | Configuration for user pool domain | object({ |
null |
no |
user_pool_groups | List of user pool groups to create | list(object({ |
[] |
no |
user_pool_tier | The user pool feature plan, or tier | string |
"ESSENTIALS" |
no |
user_pool_users | List of Cognito users to create | list(object({ |
[] |
no |
username_attributes | Whether email addresses or phone numbers can be specified as usernames when a user signs up | list(string) |
[] |
no |
username_configuration | Configuration for username settings | object({ |
{} |
no |
verification_message_template | Configuration for verification message templates | object({ |
null |
no |
web_acl_arn | Optional WAF Web ACL ARN to associate with Cognito User Pool. Null = inactive | string |
null |
no |
web_authn_configuration | Configuration for web authn (passkey) settings | object({ |
null |
no |
Outputs¶
Name | Description |
---|---|
identity_provider_names | The names of the Cognito Identity Providers |
identity_providers | Map of identity provider details |
resource_server_identifiers | The identifiers of the Cognito Resource Servers |
resource_server_names | The names of the Cognito Resource Servers |
resource_servers | Map of resource server details |
summary | Summary of all created resources |
user_pool_arn | The ARN of the Cognito User Pool |
user_pool_client_ids | The IDs of the Cognito User Pool Clients |
user_pool_client_names | The names of the Cognito User Pool Clients |
user_pool_client_secrets | The client secrets of the Cognito User Pool Clients (sensitive) |
user_pool_clients | Map of user pool client details |
user_pool_creation_date | The date the Cognito User Pool was created |
user_pool_custom_domain | The custom domain name for the user pool |
user_pool_domain | The domain prefix if the user pool has a domain associated with it |
user_pool_domain_aws_account_id | The AWS account ID for the user pool domain |
user_pool_domain_cloudfront_distribution_arn | The ARN of the CloudFront distribution for the domain |
user_pool_domain_name | The domain name of the Cognito User Pool Domain |
user_pool_domain_s3_bucket | The S3 bucket where the static files for this domain are stored |
user_pool_domain_version | The app version for the domain |
user_pool_endpoint | The endpoint name of the Cognito User Pool |
user_pool_estimated_number_of_users | A number estimating the size of the user pool |
user_pool_group_names | The names of the Cognito User Pool Groups |
user_pool_groups | Map of user pool group details |
user_pool_hosted_ui_url | The URL of the hosted UI for the user pool (if domain is configured) |
user_pool_id | The ID of the Cognito User Pool |
user_pool_issuer | The issuer URL for the user pool |
user_pool_jwks_uri | The JSON Web Key Set (JWKS) URI for the user pool |
user_pool_last_modified_date | The date the Cognito User Pool was last modified |
user_pool_name | The name of the Cognito User Pool |
Development¶
Prerequisites¶
Configurations¶
- Configure pre-commit hooks
Versioning¶
while Contributing or doing git commit please specify the breaking change in your commit message whether its major,minor or patch
For Example
Authors¶
This project is authored by: - SourceFuse ARC Team