@@ -44,20 +44,17 @@ const backend = defineBackend({
44
44
});
45
45
// extract L1 CfnUserPool resources
46
46
const { cfnUserPool } = backend .auth .resources .cfnResources ;
47
- // use CDK's `addPropertyOverride` to modify properties directly
48
- cfnUserPool .addPropertyOverride (
49
- " Policies" ,
50
- {
51
- PasswordPolicy: {
52
- MinimumLength: 10 ,
53
- RequireLowercase: true ,
54
- RequireNumbers: true ,
55
- RequireSymbols: true ,
56
- RequireUppercase: true ,
57
- TemporaryPasswordValidityDays: 20 ,
58
- },
59
- }
60
- );
47
+ // modify cfnUserPool policies directly
48
+ cfnUserPool .policies = {
49
+ passwordPolicy: {
50
+ minimumLength: 10 ,
51
+ requireLowercase: true ,
52
+ requireNumbers: true ,
53
+ requireSymbols: true ,
54
+ requireUppercase: true ,
55
+ temporaryPasswordValidityDays: 20 ,
56
+ },
57
+ };
61
58
```
62
59
63
60
## Custom Attributes
@@ -76,14 +73,14 @@ const backend = defineBackend({
76
73
77
74
// extract L1 CfnUserPool resources
78
75
const { cfnUserPool } = backend .auth .resources .cfnResources ;
79
- // use CDK's `addPropertyOverride` to modify properties directly
80
- cfnUserPool . addPropertyOverride ( " Schema " , [
81
- {
82
- Name: " publicName " ,
83
- AttributeDataType: " String " ,
84
- Mutable : true ,
85
- },
86
- ]);
76
+ // update the schema property to add custom attributes
77
+ if ( Array . isArray ( cfnUserPool . schema )) {
78
+ cfnUserPool . schema . push ( {
79
+ name: ' policyName ' ,
80
+ attributeDataType: ' Boolean ' ,
81
+ developerOnlyAttribute : true ,
82
+ });
83
+ }
87
84
```
88
85
89
86
{ /* token validity */ }
0 commit comments