Skip to content

Commit

Permalink
update password policy override
Browse files Browse the repository at this point in the history
  • Loading branch information
josefaidt committed Oct 11, 2024
1 parent 827cf20 commit 15be2fa
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,18 +521,23 @@ You can customize the password format acceptable by your auth backend. By defaul
- `tempPasswordValidity`: 3 days
```ts title="amplify/backend.ts"
// amplify/backend.ts
import { defineBackend } from '@aws-amplify/backend';
import { auth } from './auth/resource';
import { data } from './data/resource';
const backend = defineBackend({
auth,
data
});
// extract L1 UserPool construct
// extract L1 CfnUserPool resources
const { cfnUserPool } = backend.auth.resources.cfnResources;
// from the CDK use `addPropertyOverride` to modify properties directly
cfnUserPool.addPropertyOverride('Policies.PasswordPolicy.MinimumLength', 32);
// modify cfnUserPool policies directly
cfnUserPool.policies = {
passwordPolicy: {
minimumLength: 32,
requireLowercase: true,
requireNumbers: true,
requireSymbols: true,
requireUppercase: true,
temporaryPasswordValidityDays: 20,
},
};
```

0 comments on commit 15be2fa

Please sign in to comment.