Cognito User Pool Deployer
What this skill does
Provisions Amazon Cognito user pools with secure identity defaults —
correct attribute schema, password policy, MFA (TOTP preferred over SMS),
OAuth code flow with PKCE (never implicit), SRP-only auth flows,
PreventUserExistenceErrors: ENABLED, and Advanced Security Features
(ASF) in ENFORCED mode. Runs deterministic pre-checks before any
state-changing CLI (does the SMS-MFA SNS role exist? is the custom domain
ACM cert in us-east-1 and ISSUED? does the SAML IdP metadata resolve?
does the operator hold cognito-idp:CreateUserPool?), emits the exact
create-user-pool and create-user-pool-client CLIs behind a CONFIRM
gate, and verifies the pool via describe-user-pool. Every pool plan
surfaces the implicit-flow block, the ADMIN auth flow block, the deletion
protection default, and the token validity ceiling.
Quick navigation
| Section |
What it covers |
When to read it |
| Quick reference |
Verdict thresholds + pre-check priority order + pool config matrix |
Before any operation |
| Mindset |
Why defaults matter; Cognito silent-failure modes; overwrite traps |
Understanding the deployment model |
| Pre-flight |
Pool metadata gate — IdP metadata, ACM cert, SNS role, Lambda ARNs |
Before executing any CLI |
| Process |
Per-operation planning: create, update, add IdP, register domain |
When choosing which operation |
| Common patterns |
Production user pool / SAML federation / client credentials / custom domain boilerplate |
Boilerplate lookup |
| STRICT output contract |
Required POOL/VERDICT/PRE_CHECKS/STEPS/POST_VERIFY block |
Formatting the response |
| NEVER (top 5) |
Hard rules that prevent common insecure patterns |
Review before deploy |
| Expert heuristic |
When MFA mode is acceptable per use case |
Choosing MFA strategy |
Quick reference — verdict thresholds
| Verdict |
Trigger condition |
Action |
PREREQUISITES_MISSING |
Any pre-check failed (SNS role missing for SMS MFA, ACM cert wrong region/ISSUED pending, IdP metadata unresolvable, Lambda ARN invalid, IAM permission missing, Implicit OAuth flow requested, ADMIN auth flow requested, duplicate pool/client name, custom attribute deviates from custom: prefix, deletion protection inactive on update) |
List failures, do NOT execute |
READY_TO_DEPLOY |
All pre-checks passed; awaiting CONFIRM gate |
Emit exact CLI sequence with full pool config, wait for operator yes |
Priority order for pre-checks (apply in this sequence, all must pass for
READY_TO_DEPLOY):
- Pool name uniqueness —
list-user-pools returns no pool with the
target name (for create) or matches exactly one (for update).
- Deletion protection — for update operations, the existing pool has
DeletionProtection: ACTIVE. Updating a pool with INACTIVE deletion
protection blocks production-grade deploys.
- Attribute schema — every standard attribute referenced in
RequiredAttributes is in Schema (auto-added by Cognito but
explicitly declared is safer). Custom attributes use custom: prefix
and the type is consistent.
- Password policy — minimum length >= 12, contains uppercase,
lowercase, numbers, symbols.
TemporaryPasswordValidityDays <= 7.
- MFA prerequisites — if
MfaConfiguration: ON with SMS:
sms_configuration.SnsCallerArn resolves to an IAM role in the
account; if TOTP only: no SNS role required.
- App client auth flows — only
ALLOW_USER_SRP_AUTH and
ALLOW_REFRESH_TOKEN_AUTH allowed. ALLOW_ADMIN_USER_PASSWORD_AUTH
and ALLOW_USER_PASSWORD_AUTH are blocked.
- OAuth flows — only
code grant allowed. implicit grant is
blocked. client-credentials requires a resource server with scopes
and GenerateClientSecret: true.
- PreventUserExistenceErrors — set to
ENABLED (default for new
pools). LEGACY is blocked.
- Advanced Security Features —
UserPoolAddOns.AdvancedSecurityMode
is ENFORCED (not AUDIT or OFF).
- Token validity —
AccessTokenValidity 5 min - 1 hour,
IdTokenValidity 5 min - 1 hour, RefreshTokenValidity 1-3650 days.
- Identity provider metadata — for SAML: metadata document or
metadata URL resolves; for OIDC: issuer URL, authorize/auth/userinfo
endpoints resolve and client credentials provided.
- Lambda triggers — every ARN in
LambdaConfig resolves via
lambda:get-function and the pool has lambda:InvokeFunction
permission via resource-based policy.
- Custom domain ACM cert — if
CustomDomainConfig is set, the ACM
certificate ARN is in us-east-1 and status is ISSUED. The cert
subject/alt names cover the domain.
- IAM permissions — the operator principal holds
cognito-idp:CreateUserPool (and iam:PassRole if SMS SNS role
configured).
Cognito limits (2026):
- User pools per account (default): 1000 (soft limit).
- App clients per user pool: 1000.
- Identity providers per user pool: 100.
- Resource servers per user pool: 100.
- Custom attributes per pool: 25.
- User pool groups per pool: 1000.
- Hosted UI domain name length: 63 chars, alphanumeric + hyphen.
- RefreshTokenValidity max: 3650 days.
Mindset
One-line takeaway: Cognito silently accepts insecure configurations.
A pool with MfaConfiguration: OFF, an app client with
ALLOW_USER_PASSWORD_AUTH, or an OAuth implicit grant will all deploy
successfully and operate — until a credential is leaked or an attacker
enumerates users. The skill enforces the secure-by-default stance by
blocking these patterns at the pre-check gate rather than at runtime.
Driven by three Cognito realities:
create-user-pool is all-or-nothing on the schema. The
Schema array can be set only at pool creation. Adding a required
attribute to an existing pool requires migration to a new pool.
Pre-flight attribute schema validation is non-negotiable — missing an
attribute at create time means a multi-week user migration to fix.
MFA configuration is per-pool, but MFA factors are per-user.
MfaConfiguration: ON requires every user to set up MFA, but
ENABLED (optional) lets users skip. SMS MFA requires an SNS caller
role — if the role is missing, the pool will deploy and users will
receive sign-in errors at the moment they try to set up SMS. The
pre-flight gate catches this at deploy time.
App client settings silently downgrade security. An app client
with GenerateClientSecret: false (public client) is valid for
mobile/SPA scenarios, but combined with ALLOW_USER_PASSWORD_AUTH it
leaks credentials to the client. The skill blocks this combination
at the pre-check gate rather than at runtime.
Pre-flight: user pool metadata gate
Run before classification. Misclassifying these produces wrong plans.
Moved verbatim to references/diagnostic-commands.md - load on demand (see References below).
Malformed input: if the pool spec is missing required fields
(PoolName, Policies.PasswordPolicy, or MfaConfiguration), emit
VERDICT: PREREQUISITES_MISSING with REASON: Pool spec missing required field — PoolName, PasswordPolicy, or MfaConfiguration. Cannot plan. and
REMEDIATION: Provide the full pool configuration per https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-create-ing-cli.html.
| Attribute |
Effect on operation |
| Pool name already exists |
Update operation. Must snapshot existing config first. Schema changes will be rejected. |
| SMS MFA without SNS caller role |
Users will see "Invalid SMS role" at sign-up. PREREQUISITES_MISSING. |
Custom attribute without custom: prefix |
Cognito rejects the schema. PREREQUISITES_MISSING. |
OAuth implicit grant requested |
Token leakage via URL fragment. PREREQUISITES_MISSING — blocked at pre-check. |
ALLOW_ADMIN_USER_PASSWORD_AUTH requested |
Bypasses SRP, leaks admin creds. PREREQUISITES_MISSING — blocked at pre-check. |
| ACM cert in non-us-east-1 region |
Custom domain will not validate. PREREQUISITES_MISSING. |
| Lambda trigger ARN not invocable |
Trigger silently does not fire. PREREQUISITES_MISSING. |
ASF mode AUDIT only |
Adaptive protection logs but does not enforce. Flag in NOTES, allow if user-acknowledged. |
Process — operation planning (apply in order)
Step 0: Expert knowledge — non-obvious Cognito behaviors
Moved verbatim to references/advanced-patterns.md - load on demand (see References below).
Step 1: Pre-check gate — PREREQUISITES_MISSING if any check fails
Run ALL of the following pre-checks. If ANY fails, the verdict is
PREREQUISITES_MISSING with the failed checks enumerated in PRE_CHECKS.
Do NOT execute.
For ALL operations:
- Pool name is set, <= 128 chars, matches
[\w\s+=,.@-]+.
- Password policy minimum length >= 12, all character classes true,
TemporaryPasswordValidityDays <= 7.
MfaConfiguration is one of OFF, ON, OPTIONAL.
PreventUserExistenceErrors: ENABLED.
DeletionProtection: ACTIVE.
UserPoolAddOns.AdvancedSecurityMode: ENFORCED.
- IAM principal holds
cognito-idp:CreateUserPool.
For create-user-pool:
8. Pool name does not collide with an existing pool (list-user-pools).
9. Schema: each custom attribute prefixed with custom:, type matches.
10. RequiredAttributes is a subset of Schema (or auto-added standard
attributes).
11. UsernameAttributes is either ["email"], ["phone_number"], or
["email","phone_number"]. Empty = username (alias) mode.
12. AccountRecoverySettingMechanisms are valid (verified_email,
verified_phone_number, etc.).
For SMS MFA (MfaConfiguration ON with SMS in EnabledMfas):
13. SmsConfiguration.SnsCallerArn resolves to an IAM role.
14. The role trusts cognito-idp.amazonaws.com and has
sns:Publish permission.
15. ExternalId is set on the trust policy.
For app client (create-user-pool-client):
16. ExplicitAuthFlows contains ONLY ALLOW_USER_SRP_AUTH and
ALLOW_REFRESH_TOKEN_AUTH (server-side clients may add
ALLOW_USER_PASSWORD_AUTH with a documented justification).
17. AllowedOAuthFlows contains ONLY code (and optionally
client-credentials if a resource server is configured).
implicit is BLOCKED.
18. GenerateClientSecret: true for confidential clients.
Machine clients (client-credentials) MUST have it true.
19. AllowedOAuthScopes only references scopes defined on a resource
server in this pool (besides standard openid, email,
phone, profile).
20. CallbackURLs and LogoutURLs are HTTPS (HTTP only for localhost
during development).
21. EnableTokenRevocation: true.
22. AccessTokenValidity and IdTokenValidity <= 1 hour (in explicit
TokenValidityUnits).
23. RefreshTokenValidity <= 3650 days (10 years).
For SAML identity provider:
24. ProviderDetails.MetadataFile or MetadataURL is provided and
resolves.
25. For MetadataURL: HTTPS endpoint reachable, returns XML with
EntityDescriptor.
For OIDC identity provider:
26. ProviderDetails.OIDCIssuer is HTTPS URL.
27. authorize, token, userInfo endpoints resolvable from
.well-known/openid-configuration.
28. ClientId and ClientSecret set.
For Lambda triggers (LambdaConfig):
29. Every ARN resolves via lambda:get-function.
30. The user pool service principal has lambda:InvokeFunction on each
function's resource-based policy.
For custom domain (CustomDomainConfig):
31. ACM cert ARN is in us-east-1.
32. describe-certificate returns status ISSUED.
33. Cert subject/alt names cover the custom domain.
Step 2: READY_TO_DEPLOY — emit deployment plan
If all pre-checks pass, emit VERDICT: READY_TO_DEPLOY with the exact
CLI sequence and the CONFIRM gate. The plan includes:
- The exact
aws cognito-idp create-user-pool CLI with the full config
(Schema, Policies, MfaConfiguration, UserPoolAddOns, LambdaConfig,
AccountRecoverySetting, DeletionProtection).
- The follow-up
create-user-pool-client CLI for each app client.
- The follow-up
create-identity-provider CLI for each IdP.
- The follow-up
create-resource-server CLI for each resource server.
- The follow-up
create-group CLI for each group.
- The follow-up
create-user-pool-domain (Cognito or custom) CLI.
- The CONFIRM gate prompt.
Step 3: Execute behind CONFIRM gate
- MANDATORY CONFIRMATION GATE. Before any state-changing CLI
(
create-user-pool, update-user-pool, delete-user-pool), emit:
CONFIRM: About to <operation> user pool <name> in account <account> region <region>. This will <consequence>. Proceed? (yes/no). Do NOT
execute until the operator confirms.
- Snapshot the current pool config before modification:
`aws cognito-idp describe-user-pool --user-pool-id --output json
/tmp/-backup-$(date +%s).json`.
- Execute the CLI with the full pool config.
Step 4: Post-verification
After the operation finishes, run post-verification:
describe-user-pool --user-pool-id <id> returns the expected pool
config (Schema, Policies, MfaConfiguration, UserPoolAddOns).
list-user-pool-clients --user-pool-id <id> returns the expected
clients with correct ExplicitAuthFlows.
- For SMS MFA:
list-identity-providers (no-op verification — IAM role
is exercised only at user sign-up time, but the role exists).
- For Lambda triggers: invoke the trigger manually with a synthetic
event to confirm the resource-based policy allows the pool to call.
- For custom domain:
describe-user-pool-domain --domain <domain>
returns status CREATING, then ACTIVE (verify DNS).
Common pool patterns (boilerplate)
Moved verbatim to references/worked-examples.md - load on demand (see References below).
STRICT output contract
Required output structure
Every response MUST begin with this block — no preamble, no conversational
opening:
POOL: <pool-name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
TARGET: <pool-name> (pool-id: <id> for updates)
PRE_CHECKS:
- [PASS] <check description>
- [FAIL] <check description> — <reason>
STEPS:
1. CONFIRM: About to <operation> pool <name> in account <account> region <region>. This will <consequence>. Proceed? (yes/no)
2. <exact CLI command — no placeholders>
POST_VERIFY:
- [PASS] <verification description>
- [FAIL] <verification description> — <reason>
ATTRIBUTES: <count> standard, <count> custom
MFA: OFF | TOTP-only | SMS-only | TOTP+SMS (config: ON|OPTIONAL)
OAUTH_FLOWS: code | client-credentials | (blocked: implicit)
IDPS: <count> SAML, <count> OIDC, <count> social
ASF: ENFORCED | AUDIT | OFF
NOTES: <security posture, MFA strategy, attribute schema caveats>
FORBIDDEN output patterns
- NEVER start with "Let me analyze…" or "I'll create…" — the VERDICT
block is the FIRST line, always. No conversational preamble.
- NEVER use lowercase verdict values — emit
READY_TO_DEPLOY or
PREREQUISITES_MISSING (not ready, prerequisites).
- NEVER omit PRE_CHECKS — every pre-check run must appear with
[PASS]
or [FAIL] and a specific reason for each failure. An empty
PRE_CHECKS block is non-compliant.
- NEVER emit a plan with placeholder values (e.g.,
<pool-id>,
<account-id>) in a READY_TO_DEPLOY plan — every field must be
populated with actual values from the input.
- NEVER omit the CONFIRM gate as the first STEPS entry for any
state-changing operation.
- NEVER claim success without verifying that the pool was created
(via
describe-user-pool) — a partial CLI sequence with missing
required subcommands is non-compliant.
- NEVER put-update a pool without snapshotting the existing config first
— updates to
LambdaConfig and MfaConfiguration overwrite silently.
- NEVER silently allow
implicit OAuth flow — block it explicitly with
a [FAIL] pre-check row naming the security risk.
Perfect example output
POOL: prod-users
VERDICT: READY_TO_DEPLOY
TARGET: prod-users
PRE_CHECKS:
- [PASS] Pool name unique (no collision in list-user-pools)
- [PASS] Password policy: 16 chars, all classes, 1-day temp
- [PASS] MFA: TOTP-only, no SMS role required
- [PASS] Username attributes: ["email"]
- [PASS] Custom attributes prefixed custom: (custom:tenantId)
- [PASS] DeletionProtection: ACTIVE
- [PASS] PreventUserExistenceErrors: ENABLED
- [PASS] AdvancedSecurityMode: ENFORCED
- [PASS] Account recovery: verified_email (priority 1)
- [PASS] IAM principal holds cognito-idp:CreateUserPool
STEPS:
1. CONFIRM: About to create-user-pool prod-users in account 111111111111 region us-east-1. This will CREATE a new user pool with TOTP MFA, 4 attributes, and ENFORCED ASF. Proceed? (yes/no)
2. aws cognito-idp create-user-pool --pool-name prod-users --policies '{...}' --mfa-configuration ON --enabled-mfas '["TOTP"]' --username-attributes '["email"]' --schema '[...]' --user-pool-add-ons 'AdvancedSecurityMode=ENFORCED' --deletion-protection ACTIVE --prevent-user-existence-errors ENABLED
3. aws cognito-idp create-user-pool-client --user-pool-id <returned-id> --client-name prod-web-spa --generate-client-secret --explicit-auth-flows ALLOW_USER_SRP_AUTH ALLOW_REFRESH_TOKEN_AUTH --allowed-o-auth-flows code --allowed-o-auth-scopes openid email profile --callback-urls '["https://app.example.com/callback"]' --logout-urls '["https://app.example.com/logout"]' --access-token-validity 1 --id-token-validity 1 --token-validity-units '{"AccessToken":"hours","IdToken":"hours"}' --refresh-token-validity 30 --enable-token-revocation --prevent-user-existence-errors ENABLED
POST_VERIFY:
- (pending execution)
- describe-user-pool returns the pool with MfaConfiguration=ON, AdvancedSecurityMode=ENFORCED
- list-user-pool-clients returns prod-web-spa with ExplicitAuthFlows=[ALLOW_USER_SRP_AUTH, ALLOW_REFRESH_TOKEN_AUTH]
ATTRIBUTES: 3 standard (email, given_name, family_name), 1 custom (custom:tenantId)
MFA: TOTP-only (config: ON)
OAUTH_FLOWS: code
IDPS: 0 SAML, 0 OIDC, 0 social
ASF: ENFORCED
NOTES:
- TOTP-only MFA avoids SNS SMS per-message cost — users enroll via authenticator app (Google Authenticator, Authy, 1Password).
- RefreshTokenValidity 30 days balances UX and security; reduce to 1 day for high-trust environments.
- Custom attribute custom:tenantId is immutable — set once at signup via pre-signup Lambda.
- Add the identity pool later if you need AWS credential vending to authenticated users (out of scope here).
NEVER (top 5)
These are the highest-impact, most-frequent failure modes in Cognito
deployments. Violating any one of these is a security regression.
NEVER enable OAuth implicit flow. Tokens are returned via the
URL fragment — leaks via browser history, Referer headers, and
proxy logs. Always use code grant with PKCE for SPA and mobile
clients. Block at pre-check; never silently rewrite.
NEVER enable ALLOW_ADMIN_USER_PASSWORD_AUTH on a public client.
It bypasses SRP, exposes admin credentials to the client, and is
the #1 path to credential compromise. For confidential server-side
clients only, and only with documented justification. Block at
pre-check.
NEVER create a user pool without DeletionProtection: ACTIVE.
Accidental pool deletion destroys user accounts with no recovery —
Cognito has no recycle bin. Active protection requires an explicit
--deletion-protection INACTIVE step before delete.
NEVER deploy SMS MFA without verifying the SNS caller role.
The pool will deploy cleanly but every SMS-OTP sign-up will fail
with "Invalid SMS role" at the moment a user tries to enroll. Verify
the role exists, trusts cognito-idp.amazonaws.com, has
sns:Publish, and uses ExternalId for cross-account trust.
NEVER put a custom attribute in RequiredAttributes without
declaring it in Schema. Cognito silently accepts but the
attribute is never written — signups fail at the moment of attribute
collection. Always declare in both arrays, prefixed with custom:.
Expert heuristic: choosing MFA strategy
The right MFA strategy is a function of user population, network, and
cost tolerance — not a one-size-fits-all. The heuristic below resolves
the trade-off deterministically.
User population / environment
├─ B2C consumer app (mobile/web)?
│ ├─ TOTP only (Authenticator app)
│ │ Users install Google Authenticator once. No per-message
│ │ cost. Works offline. Best UX if app supports enrollment QR.
│ └─ SMS as backup only (OPTIONAL + both factors enabled)
│ SMS incurs $0.00645/msg in the US, more internationally.
│ Use only when TOTP is impossible (low-tech user base).
│
├─ B2B / workforce?
│ └─ TOTP only. Strict ON policy. No SMS — corporate devices
│ support authenticators and SMS is exposed to SIM swap.
│
├─ Regulated (PCI/HIPAA/Government)?
│ └─ TOTP ON + ASF ENFORCED. SMS not accepted by most auditors
│ as a second factor — SIM swap is a recognized attack.
│
└─ Development / staging?
└─ MFA OFF acceptable if ASF ENFORCED for adaptive defense.
Production must still enforce TOTP ON. NEVER disable ASF.
Decision rules:
- Default to TOTP-only. Add SMS only if (a) the user population cannot
install authenticators, OR (b) a documented regulation requires it.
- Always pair MFA with ASF ENFORCED. MFA alone does not stop credential
stuffing — ASF detects the pattern.
- SMS requires an SNS caller role with cross-account ExternalId. The
pre-check gate verifies this.
- TOTP enrollment requires a per-user
SoftwareTokenMfaSettings write
via cognito-idp:associate-software-token — outside the deploy scope
but flag in NOTES for the application team.
ALWAYS emit AdvancedSecurityMode: ENFORCED for production pools. AUDIT
mode is acceptable only in staging for evaluating ASF false-positive
rates before promoting to ENFORCED.
Recent AWS features (2024-2026)
Moved verbatim to references/advanced-patterns.md - load on demand (see References below).
AWS documentation
References (load on demand)
- references/advanced-patterns.md — Step-0 expert Cognito behaviors and 2024-2026 feature changes moved from SKILL.md
- references/worked-examples.md — common pool / client / IdP / domain / trigger / group CLI boilerplate moved from SKILL.md
- references/diagnostic-commands.md — live-account pre-flight command listing moved from SKILL.md
- references/pool-config-and-security-defaults.md — pool archetypes, app client procedure, token validity, verification commands
- references/identity-providers-and-triggers.md — SAML/OIDC/social IdP, Lambda trigger, and domain procedures
Domain
AWS CloudOps / Identity & Access Management — Cognito User Pool Provisioning.
1---2name: cognito-user-pool-deployer3description: Provisions Amazon Cognito user pools with secure defaults — user pool attributes (standard and custom), password policy, MFA (SMS/TOTP), app clients (OAuth code+PKCE, client credentials), hosted UI customization, identity providers (SAML/OIDC/Social), Lambda triggers (pre-signup, post-confirmation, custom message, pre-token-generation), user pool groups, resource servers with custom scopes, domain (Cognito or custom), advanced security features (ASF ENFORCED), and hosted UI branding. Runs pre-checks (attribute schema, MFA SNS prerequisites, Lambda ARNs, custom domain ACM cert, IdP metadata, IAM permissions), emits create-user-pool and create-user-pool-client CLIs behind a CONFIRM gate, verifies via describe-user-pool. Emits READY_TO_DEPLOY | PREREQUISITES_MISSING. Use when creating user pools, configuring OAuth clients, federating SAML/OIDC, or enabling advanced security features.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline plan classification. Live-account operations use aws cognito-idp create-user-pool, create-user-pool-client, create-identity-provider, create-resource-server, create-group, create-user-pool-domain, update-user-pool, describe-user-pool (AWS CLI v2, SSO or key-based credentials).6metadata:7 source: https://skillmd.com/skills/jhkchan/cognito-user-pool-deployer8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '1'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Security15 task_type: deploy16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY_TO_DEPLOY | PREREQUISITES_MISSING19 version: 0.1.020 author: Jacky Chan — AWS Community Builder21 tags: cognito, security, identity, mfa, oauth, saml, oidc, deploy, user-pool, hosted-ui22 dependencies: aws-orchestrator23 keywords: Cognito, user pool, identity provider, IdP, MFA, TOTP, SMS MFA, password policy, app client, OAuth, code flow, PKCE, client credentials, SAML, OIDC, social login, hosted UI, branding, Lambda triggers, pre-signup, post-confirmation, custom message, pre-token-generation, resource server, custom scopes, user pool groups, custom domain, advanced security features, ASF, cognito-idp24 when_to_use: Creating a new Cognito user pool, configuring an OAuth app client, federating with SAML/OIDC/social identity providers, setting up hosted UI branding, wiring Lambda triggers (pre-signup, post- confirmation, custom message, pre-token-generation), enabling advanced security features (ASF ENFORCED), or registering a custom domain for the hosted UI.25 activation_triggers: create Cognito user pool, provision user pool, deploy Cognito, OAuth app client, code flow with PKCE, client credentials grant, SAML federation, OIDC identity provider, social login, hosted UI, Cognito branding, pre-signup trigger, post-confirmation trigger, custom message trigger, pre-token-generation trigger, resource server custom scopes, user pool groups, custom domain Cognito, advanced security features, cognito-idp create-user-pool26 invocation_schema: 'Input: either (a) a user pool deployment intent (create, update) with target pool name, attribute schema, password policy, MFA mode, app client OAuth config, identity providers, Lambda triggers, resource servers, groups, and domain; OR (b) a user pool id for live-account update or validation. Output: deterministic POOL/VERDICT/PRE_CHECKS/ STEPS/POST_VERIFY block per operation, where VERDICT is one of READY_TO_DEPLOY, PREREQUISITES_MISSING.'27---2829# Cognito User Pool Deployer3031## What this skill does3233Provisions Amazon Cognito user pools with secure identity defaults —34correct attribute schema, password policy, MFA (TOTP preferred over SMS),35OAuth code flow with PKCE (never implicit), SRP-only auth flows,36`PreventUserExistenceErrors: ENABLED`, and Advanced Security Features37(ASF) in ENFORCED mode. Runs deterministic pre-checks before any38state-changing CLI (does the SMS-MFA SNS role exist? is the custom domain39ACM cert in us-east-1 and ISSUED? does the SAML IdP metadata resolve?40does the operator hold `cognito-idp:CreateUserPool`?), emits the exact41`create-user-pool` and `create-user-pool-client` CLIs behind a CONFIRM42gate, and verifies the pool via `describe-user-pool`. Every pool plan43surfaces the implicit-flow block, the ADMIN auth flow block, the deletion44protection default, and the token validity ceiling.4546## Quick navigation4748| Section | What it covers | When to read it |49|---|---|---|50| **Quick reference** | Verdict thresholds + pre-check priority order + pool config matrix | Before any operation |51| **Mindset** | Why defaults matter; Cognito silent-failure modes; overwrite traps | Understanding the deployment model |52| **Pre-flight** | Pool metadata gate — IdP metadata, ACM cert, SNS role, Lambda ARNs | Before executing any CLI |53| **Process** | Per-operation planning: create, update, add IdP, register domain | When choosing which operation |54| **Common patterns** | Production user pool / SAML federation / client credentials / custom domain boilerplate | Boilerplate lookup |55| **STRICT output contract** | Required POOL/VERDICT/PRE_CHECKS/STEPS/POST_VERIFY block | Formatting the response |56| **NEVER (top 5)** | Hard rules that prevent common insecure patterns | Review before deploy |57| **Expert heuristic** | When MFA mode is acceptable per use case | Choosing MFA strategy |5859## Quick reference — verdict thresholds6061| Verdict | Trigger condition | Action |62|---|---|---|63| `PREREQUISITES_MISSING` | Any pre-check failed (SNS role missing for SMS MFA, ACM cert wrong region/ISSUED pending, IdP metadata unresolvable, Lambda ARN invalid, IAM permission missing, Implicit OAuth flow requested, ADMIN auth flow requested, duplicate pool/client name, custom attribute deviates from `custom:` prefix, deletion protection inactive on update) | List failures, do NOT execute |64| `READY_TO_DEPLOY` | All pre-checks passed; awaiting CONFIRM gate | Emit exact CLI sequence with full pool config, wait for operator yes |6566**Priority order for pre-checks (apply in this sequence, all must pass for67READY_TO_DEPLOY):**68691. **Pool name uniqueness** — `list-user-pools` returns no pool with the70 target name (for create) or matches exactly one (for update).712. **Deletion protection** — for update operations, the existing pool has72 `DeletionProtection: ACTIVE`. Updating a pool with `INACTIVE` deletion73 protection blocks production-grade deploys.743. **Attribute schema** — every standard attribute referenced in75 `RequiredAttributes` is in `Schema` (auto-added by Cognito but76 explicitly declared is safer). Custom attributes use `custom:` prefix77 and the type is consistent.784. **Password policy** — minimum length >= 12, contains uppercase,79 lowercase, numbers, symbols. `TemporaryPasswordValidityDays` <= 7.805. **MFA prerequisites** — if `MfaConfiguration: ON` with SMS:81 `sms_configuration.SnsCallerArn` resolves to an IAM role in the82 account; if TOTP only: no SNS role required.836. **App client auth flows** — only `ALLOW_USER_SRP_AUTH` and84 `ALLOW_REFRESH_TOKEN_AUTH` allowed. `ALLOW_ADMIN_USER_PASSWORD_AUTH`85 and `ALLOW_USER_PASSWORD_AUTH` are blocked.867. **OAuth flows** — only `code` grant allowed. `implicit` grant is87 blocked. `client-credentials` requires a resource server with scopes88 and `GenerateClientSecret: true`.898. **PreventUserExistenceErrors** — set to `ENABLED` (default for new90 pools). `LEGACY` is blocked.919. **Advanced Security Features** — `UserPoolAddOns.AdvancedSecurityMode`92 is `ENFORCED` (not `AUDIT` or `OFF`).9310. **Token validity** — `AccessTokenValidity` 5 min - 1 hour,94 `IdTokenValidity` 5 min - 1 hour, `RefreshTokenValidity` 1-3650 days.9511. **Identity provider metadata** — for SAML: metadata document or96 metadata URL resolves; for OIDC: issuer URL, authorize/auth/userinfo97 endpoints resolve and client credentials provided.9812. **Lambda triggers** — every ARN in `LambdaConfig` resolves via99 `lambda:get-function` and the pool has `lambda:InvokeFunction`100 permission via resource-based policy.10113. **Custom domain ACM cert** — if `CustomDomainConfig` is set, the ACM102 certificate ARN is in us-east-1 and status is `ISSUED`. The cert103 subject/alt names cover the domain.10414. **IAM permissions** — the operator principal holds105 `cognito-idp:CreateUserPool` (and `iam:PassRole` if SMS SNS role106 configured).107108**Cognito limits (2026):**109110- User pools per account (default): 1000 (soft limit).111- App clients per user pool: 1000.112- Identity providers per user pool: 100.113- Resource servers per user pool: 100.114- Custom attributes per pool: 25.115- User pool groups per pool: 1000.116- Hosted UI domain name length: 63 chars, alphanumeric + hyphen.117- RefreshTokenValidity max: 3650 days.118119## Mindset120121**One-line takeaway:** Cognito silently accepts insecure configurations.122A pool with `MfaConfiguration: OFF`, an app client with123`ALLOW_USER_PASSWORD_AUTH`, or an OAuth `implicit` grant will all deploy124successfully and operate — until a credential is leaked or an attacker125enumerates users. The skill enforces the secure-by-default stance by126blocking these patterns at the pre-check gate rather than at runtime.127128Driven by three Cognito realities:129130- **create-user-pool is all-or-nothing on the schema.** The131 `Schema` array can be set only at pool creation. Adding a required132 attribute to an existing pool requires migration to a new pool.133 Pre-flight attribute schema validation is non-negotiable — missing an134 attribute at create time means a multi-week user migration to fix.135136- **MFA configuration is per-pool, but MFA factors are per-user.**137 `MfaConfiguration: ON` requires every user to set up MFA, but138 `ENABLED` (optional) lets users skip. SMS MFA requires an SNS caller139 role — if the role is missing, the pool will deploy and users will140 receive sign-in errors at the moment they try to set up SMS. The141 pre-flight gate catches this at deploy time.142143- **App client settings silently downgrade security.** An app client144 with `GenerateClientSecret: false` (public client) is valid for145 mobile/SPA scenarios, but combined with `ALLOW_USER_PASSWORD_AUTH` it146 leaks credentials to the client. The skill blocks this combination147 at the pre-check gate rather than at runtime.148149## Pre-flight: user pool metadata gate150151Run before classification. Misclassifying these produces wrong plans.152153Moved verbatim to [references/diagnostic-commands.md](references/diagnostic-commands.md) - load on demand (see References below).154155**Malformed input:** if the pool spec is missing required fields156(`PoolName`, `Policies.PasswordPolicy`, or `MfaConfiguration`), emit157`VERDICT: PREREQUISITES_MISSING` with `REASON: Pool spec missing required158field — PoolName, PasswordPolicy, or MfaConfiguration. Cannot plan.` and159`REMEDIATION: Provide the full pool configuration per160https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-create-ing-cli.html.`161162| Attribute | Effect on operation |163|---|---|164| Pool name already exists | Update operation. Must snapshot existing config first. Schema changes will be rejected. |165| SMS MFA without SNS caller role | Users will see "Invalid SMS role" at sign-up. PREREQUISITES_MISSING. |166| Custom attribute without `custom:` prefix | Cognito rejects the schema. PREREQUISITES_MISSING. |167| OAuth `implicit` grant requested | Token leakage via URL fragment. PREREQUISITES_MISSING — blocked at pre-check. |168| `ALLOW_ADMIN_USER_PASSWORD_AUTH` requested | Bypasses SRP, leaks admin creds. PREREQUISITES_MISSING — blocked at pre-check. |169| ACM cert in non-us-east-1 region | Custom domain will not validate. PREREQUISITES_MISSING. |170| Lambda trigger ARN not invocable | Trigger silently does not fire. PREREQUISITES_MISSING. |171| ASF mode `AUDIT` only | Adaptive protection logs but does not enforce. Flag in NOTES, allow if user-acknowledged. |172173## Process — operation planning (apply in order)174175### Step 0: Expert knowledge — non-obvious Cognito behaviors176177Moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md) - load on demand (see References below).178179### Step 1: Pre-check gate — PREREQUISITES_MISSING if any check fails180181Run ALL of the following pre-checks. If ANY fails, the verdict is182PREREQUISITES_MISSING with the failed checks enumerated in PRE_CHECKS.183Do NOT execute.184185**For ALL operations:**1861. Pool name is set, <= 128 chars, matches `[\w\s+=,.@-]+`.1872. Password policy minimum length >= 12, all character classes true,188 `TemporaryPasswordValidityDays` <= 7.1893. `MfaConfiguration` is one of `OFF`, `ON`, `OPTIONAL`.1904. `PreventUserExistenceErrors: ENABLED`.1915. `DeletionProtection: ACTIVE`.1926. `UserPoolAddOns.AdvancedSecurityMode: ENFORCED`.1937. IAM principal holds `cognito-idp:CreateUserPool`.194195**For create-user-pool:**1968. Pool name does not collide with an existing pool (`list-user-pools`).1979. Schema: each custom attribute prefixed with `custom:`, type matches.19810. RequiredAttributes is a subset of Schema (or auto-added standard199 attributes).20011. `UsernameAttributes` is either `["email"]`, `["phone_number"]`, or201 `["email","phone_number"]`. Empty = username (alias) mode.20212. `AccountRecoverySetting`Mechanisms are valid (verified_email,203 verified_phone_number, etc.).204205**For SMS MFA (MfaConfiguration ON with SMS in EnabledMfas):**20613. `SmsConfiguration.SnsCallerArn` resolves to an IAM role.20714. The role trusts `cognito-idp.amazonaws.com` and has208 `sns:Publish` permission.20915. ExternalId is set on the trust policy.210211**For app client (create-user-pool-client):**21216. `ExplicitAuthFlows` contains ONLY `ALLOW_USER_SRP_AUTH` and213 `ALLOW_REFRESH_TOKEN_AUTH` (server-side clients may add214 `ALLOW_USER_PASSWORD_AUTH` with a documented justification).21517. `AllowedOAuthFlows` contains ONLY `code` (and optionally216 `client-credentials` if a resource server is configured).217 `implicit` is BLOCKED.21818. `GenerateClientSecret: true` for confidential clients.219 Machine clients (`client-credentials`) MUST have it true.22019. `AllowedOAuthScopes` only references scopes defined on a resource221 server in this pool (besides standard `openid`, `email`,222 `phone`, `profile`).22320. `CallbackURLs` and `LogoutURLs` are HTTPS (HTTP only for localhost224 during development).22521. `EnableTokenRevocation: true`.22622. `AccessTokenValidity` and `IdTokenValidity` <= 1 hour (in explicit227 `TokenValidityUnits`).22823. `RefreshTokenValidity` <= 3650 days (10 years).229230**For SAML identity provider:**23124. `ProviderDetails.MetadataFile` or `MetadataURL` is provided and232 resolves.23325. For MetadataURL: HTTPS endpoint reachable, returns XML with234 `EntityDescriptor`.235236**For OIDC identity provider:**23726. `ProviderDetails.OIDCIssuer` is HTTPS URL.23827. `authorize`, `token`, `userInfo` endpoints resolvable from239 `.well-known/openid-configuration`.24028. `ClientId` and `ClientSecret` set.241242**For Lambda triggers (LambdaConfig):**24329. Every ARN resolves via `lambda:get-function`.24430. The user pool service principal has `lambda:InvokeFunction` on each245 function's resource-based policy.246247**For custom domain (CustomDomainConfig):**24831. ACM cert ARN is in us-east-1.24932. `describe-certificate` returns status `ISSUED`.25033. Cert subject/alt names cover the custom domain.251252### Step 2: READY_TO_DEPLOY — emit deployment plan253254If all pre-checks pass, emit `VERDICT: READY_TO_DEPLOY` with the exact255CLI sequence and the CONFIRM gate. The plan includes:256257- The exact `aws cognito-idp create-user-pool` CLI with the full config258 (Schema, Policies, MfaConfiguration, UserPoolAddOns, LambdaConfig,259 AccountRecoverySetting, DeletionProtection).260- The follow-up `create-user-pool-client` CLI for each app client.261- The follow-up `create-identity-provider` CLI for each IdP.262- The follow-up `create-resource-server` CLI for each resource server.263- The follow-up `create-group` CLI for each group.264- The follow-up `create-user-pool-domain` (Cognito or custom) CLI.265- The CONFIRM gate prompt.266267### Step 3: Execute behind CONFIRM gate268269- **MANDATORY CONFIRMATION GATE.** Before any state-changing CLI270 (`create-user-pool`, `update-user-pool`, `delete-user-pool`), emit:271 `CONFIRM: About to <operation> user pool <name> in account <account>272 region <region>. This will <consequence>. Proceed? (yes/no)`. Do NOT273 execute until the operator confirms.274- Snapshot the current pool config before modification:275 `aws cognito-idp describe-user-pool --user-pool-id <id> --output json276 > /tmp/<pool-name>-backup-$(date +%s).json`.277- Execute the CLI with the full pool config.278279### Step 4: Post-verification280281After the operation finishes, run post-verification:2822831. `describe-user-pool --user-pool-id <id>` returns the expected pool284 config (Schema, Policies, MfaConfiguration, UserPoolAddOns).2852. `list-user-pool-clients --user-pool-id <id>` returns the expected286 clients with correct ExplicitAuthFlows.2873. For SMS MFA: `list-identity-providers` (no-op verification — IAM role288 is exercised only at user sign-up time, but the role exists).2894. For Lambda triggers: invoke the trigger manually with a synthetic290 event to confirm the resource-based policy allows the pool to call.2915. For custom domain: `describe-user-pool-domain --domain <domain>`292 returns status `CREATING`, then `ACTIVE` (verify DNS).293294## Common pool patterns (boilerplate)295296Moved verbatim to [references/worked-examples.md](references/worked-examples.md) - load on demand (see References below).297298## STRICT output contract299300### Required output structure301302Every response MUST begin with this block — no preamble, no conversational303opening:304305```text306POOL: <pool-name>307VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING308TARGET: <pool-name> (pool-id: <id> for updates)309PRE_CHECKS:310 - [PASS] <check description>311 - [FAIL] <check description> — <reason>312STEPS:313 1. CONFIRM: About to <operation> pool <name> in account <account> region <region>. This will <consequence>. Proceed? (yes/no)314 2. <exact CLI command — no placeholders>315POST_VERIFY:316 - [PASS] <verification description>317 - [FAIL] <verification description> — <reason>318ATTRIBUTES: <count> standard, <count> custom319MFA: OFF | TOTP-only | SMS-only | TOTP+SMS (config: ON|OPTIONAL)320OAUTH_FLOWS: code | client-credentials | (blocked: implicit)321IDPS: <count> SAML, <count> OIDC, <count> social322ASF: ENFORCED | AUDIT | OFF323NOTES: <security posture, MFA strategy, attribute schema caveats>324```325326### FORBIDDEN output patterns327328- NEVER start with "Let me analyze…" or "I'll create…" — the VERDICT329 block is the FIRST line, always. No conversational preamble.330- NEVER use lowercase verdict values — emit `READY_TO_DEPLOY` or331 `PREREQUISITES_MISSING` (not `ready`, `prerequisites`).332- NEVER omit PRE_CHECKS — every pre-check run must appear with `[PASS]`333 or `[FAIL]` and a specific reason for each failure. An empty334 PRE_CHECKS block is non-compliant.335- NEVER emit a plan with placeholder values (e.g., `<pool-id>`,336 `<account-id>`) in a READY_TO_DEPLOY plan — every field must be337 populated with actual values from the input.338- NEVER omit the CONFIRM gate as the first STEPS entry for any339 state-changing operation.340- NEVER claim success without verifying that the pool was created341 (via `describe-user-pool`) — a partial CLI sequence with missing342 required subcommands is non-compliant.343- NEVER put-update a pool without snapshotting the existing config first344 — updates to `LambdaConfig` and `MfaConfiguration` overwrite silently.345- NEVER silently allow `implicit` OAuth flow — block it explicitly with346 a [FAIL] pre-check row naming the security risk.347348### Perfect example output349350```text351POOL: prod-users352VERDICT: READY_TO_DEPLOY353TARGET: prod-users354PRE_CHECKS:355 - [PASS] Pool name unique (no collision in list-user-pools)356 - [PASS] Password policy: 16 chars, all classes, 1-day temp357 - [PASS] MFA: TOTP-only, no SMS role required358 - [PASS] Username attributes: ["email"]359 - [PASS] Custom attributes prefixed custom: (custom:tenantId)360 - [PASS] DeletionProtection: ACTIVE361 - [PASS] PreventUserExistenceErrors: ENABLED362 - [PASS] AdvancedSecurityMode: ENFORCED363 - [PASS] Account recovery: verified_email (priority 1)364 - [PASS] IAM principal holds cognito-idp:CreateUserPool365STEPS:366 1. CONFIRM: About to create-user-pool prod-users in account 111111111111 region us-east-1. This will CREATE a new user pool with TOTP MFA, 4 attributes, and ENFORCED ASF. Proceed? (yes/no)367 2. aws cognito-idp create-user-pool --pool-name prod-users --policies '{...}' --mfa-configuration ON --enabled-mfas '["TOTP"]' --username-attributes '["email"]' --schema '[...]' --user-pool-add-ons 'AdvancedSecurityMode=ENFORCED' --deletion-protection ACTIVE --prevent-user-existence-errors ENABLED368 3. aws cognito-idp create-user-pool-client --user-pool-id <returned-id> --client-name prod-web-spa --generate-client-secret --explicit-auth-flows ALLOW_USER_SRP_AUTH ALLOW_REFRESH_TOKEN_AUTH --allowed-o-auth-flows code --allowed-o-auth-scopes openid email profile --callback-urls '["https://app.example.com/callback"]' --logout-urls '["https://app.example.com/logout"]' --access-token-validity 1 --id-token-validity 1 --token-validity-units '{"AccessToken":"hours","IdToken":"hours"}' --refresh-token-validity 30 --enable-token-revocation --prevent-user-existence-errors ENABLED369POST_VERIFY:370 - (pending execution)371 - describe-user-pool returns the pool with MfaConfiguration=ON, AdvancedSecurityMode=ENFORCED372 - list-user-pool-clients returns prod-web-spa with ExplicitAuthFlows=[ALLOW_USER_SRP_AUTH, ALLOW_REFRESH_TOKEN_AUTH]373ATTRIBUTES: 3 standard (email, given_name, family_name), 1 custom (custom:tenantId)374MFA: TOTP-only (config: ON)375OAUTH_FLOWS: code376IDPS: 0 SAML, 0 OIDC, 0 social377ASF: ENFORCED378NOTES:379 - TOTP-only MFA avoids SNS SMS per-message cost — users enroll via authenticator app (Google Authenticator, Authy, 1Password).380 - RefreshTokenValidity 30 days balances UX and security; reduce to 1 day for high-trust environments.381 - Custom attribute custom:tenantId is immutable — set once at signup via pre-signup Lambda.382 - Add the identity pool later if you need AWS credential vending to authenticated users (out of scope here).383```384385## NEVER (top 5)386387These are the highest-impact, most-frequent failure modes in Cognito388deployments. Violating any one of these is a security regression.3893901. **NEVER enable OAuth `implicit` flow.** Tokens are returned via the391 URL fragment — leaks via browser history, Referer headers, and392 proxy logs. Always use `code` grant with PKCE for SPA and mobile393 clients. Block at pre-check; never silently rewrite.3943952. **NEVER enable `ALLOW_ADMIN_USER_PASSWORD_AUTH` on a public client.**396 It bypasses SRP, exposes admin credentials to the client, and is397 the #1 path to credential compromise. For confidential server-side398 clients only, and only with documented justification. Block at399 pre-check.4004013. **NEVER create a user pool without `DeletionProtection: ACTIVE`.**402 Accidental pool deletion destroys user accounts with no recovery —403 Cognito has no recycle bin. Active protection requires an explicit404 `--deletion-protection INACTIVE` step before delete.4054064. **NEVER deploy SMS MFA without verifying the SNS caller role.**407 The pool will deploy cleanly but every SMS-OTP sign-up will fail408 with "Invalid SMS role" at the moment a user tries to enroll. Verify409 the role exists, trusts `cognito-idp.amazonaws.com`, has410 `sns:Publish`, and uses `ExternalId` for cross-account trust.4114125. **NEVER put a custom attribute in `RequiredAttributes` without413 declaring it in `Schema`.** Cognito silently accepts but the414 attribute is never written — signups fail at the moment of attribute415 collection. Always declare in both arrays, prefixed with `custom:`.416417## Expert heuristic: choosing MFA strategy418419The right MFA strategy is a function of user population, network, and420cost tolerance — not a one-size-fits-all. The heuristic below resolves421the trade-off deterministically.422423```424User population / environment425 ├─ B2C consumer app (mobile/web)?426 │ ├─ TOTP only (Authenticator app)427 │ │ Users install Google Authenticator once. No per-message428 │ │ cost. Works offline. Best UX if app supports enrollment QR.429 │ └─ SMS as backup only (OPTIONAL + both factors enabled)430 │ SMS incurs $0.00645/msg in the US, more internationally.431 │ Use only when TOTP is impossible (low-tech user base).432 │433 ├─ B2B / workforce?434 │ └─ TOTP only. Strict ON policy. No SMS — corporate devices435 │ support authenticators and SMS is exposed to SIM swap.436 │437 ├─ Regulated (PCI/HIPAA/Government)?438 │ └─ TOTP ON + ASF ENFORCED. SMS not accepted by most auditors439 │ as a second factor — SIM swap is a recognized attack.440 │441 └─ Development / staging?442 └─ MFA OFF acceptable if ASF ENFORCED for adaptive defense.443 Production must still enforce TOTP ON. NEVER disable ASF.444```445446**Decision rules:**447- Default to TOTP-only. Add SMS only if (a) the user population cannot448 install authenticators, OR (b) a documented regulation requires it.449- Always pair MFA with ASF ENFORCED. MFA alone does not stop credential450 stuffing — ASF detects the pattern.451- SMS requires an SNS caller role with cross-account ExternalId. The452 pre-check gate verifies this.453- TOTP enrollment requires a per-user `SoftwareTokenMfaSettings` write454 via `cognito-idp:associate-software-token` — outside the deploy scope455 but flag in NOTES for the application team.456457ALWAYS emit `AdvancedSecurityMode: ENFORCED` for production pools. AUDIT458mode is acceptable only in staging for evaluating ASF false-positive459rates before promoting to ENFORCED.460461## Recent AWS features (2024-2026)462463Moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md) - load on demand (see References below).464465## AWS documentation466467- **Amazon Cognito User Pools Developer Guide** — https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html468- **User pool attributes** — https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html469- **MFA in user pools** — https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-mfa.html470- **App client OAuth 2.0 flows** — https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-idp-settings.html471- **SAML federation** — https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-saml-idp.html472- **OIDC federation** — https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-oidc-idp.html473- **Lambda triggers** — https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html474- **Resource servers and custom scopes** — https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-define-resource-servers.html475- **Advanced Security Features** — https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html476- **Managed Login Branding** — https://docs.aws.amazon.com/cognito/latest/developerguide/managed-login-branding.html477478## References (load on demand)479480- [references/advanced-patterns.md](references/advanced-patterns.md) — Step-0 expert Cognito behaviors and 2024-2026 feature changes moved from SKILL.md481- [references/worked-examples.md](references/worked-examples.md) — common pool / client / IdP / domain / trigger / group CLI boilerplate moved from SKILL.md482- [references/diagnostic-commands.md](references/diagnostic-commands.md) — live-account pre-flight command listing moved from SKILL.md483- [references/pool-config-and-security-defaults.md](references/pool-config-and-security-defaults.md) — pool archetypes, app client procedure, token validity, verification commands484- [references/identity-providers-and-triggers.md](references/identity-providers-and-triggers.md) — SAML/OIDC/social IdP, Lambda trigger, and domain procedures485486## Domain487488AWS CloudOps / Identity & Access Management — Cognito User Pool Provisioning.