amplify-backend
amplify-backend copied to clipboard
Overriding auth attributes doesn't set the overridden values in `amplify_outputs.json`
Environment information
System:
OS: macOS 14.1.1
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 155.78 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
Yarn: Not Found
npm: 10.2.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
pnpm: Not Found
bun: Not Found
Watchman: Not Found
npmPackages:
@aws-amplify/backend: ^0.5.5 => 0.5.5
@aws-amplify/backend-cli: ^0.9.1 => 0.9.1
aws-amplify: ^6.0.5 => 6.0.5
aws-cdk: Not Found
aws-cdk-lib: Not Found
typescript: ^5.3.2 => 5.3.2
Description
In my backend.ts I have overridden my userpool password policy:
const { cfnUserPool } = backend.resources.auth.resources.cfnResources;
cfnUserPool.addPropertyOverride(
"Policies.PasswordPolicy.RequireUppercase",
false
);
cfnUserPool.addPropertyOverride(
"Policies.PasswordPolicy.RequireSymbols",
false
);
My userpool has taken the config:
However amplifyconfiguration.json shows that Symbols and Uppercase is required, which forces the Authenitactor to validate as well:
"aws_cognito_password_protection_settings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": [
"REQUIRES_NUMBERS",
"REQUIRES_LOWERCASE",
"REQUIRES_UPPERCASE", // should be false
"REQUIRES_SYMBOLS" // should be false
]
},
Thanks for the suggestion! To do this we'd need to allow setting password policies in the defineAuth function rather than in overrides. Will follow up with the product team to see if this is something we want to add.
@awsluja can this be closed now?
This is fixed in https://github.com/aws-amplify/amplify-backend/pull/1483