Skip to content

Commit

Permalink
update cognito custom attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Quan Nguyen Ba committed Nov 18, 2024
1 parent 44c28d4 commit 08c335c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
"Name": "email",
"Value": "[email protected]"
},
{
"Name": "custom:tenant_code",
"Value": "mbc"
},
{
"Name": "custom:company_code",
"Value": "00000"
},
{
"Name": "custom:member_id",
"Value": "MEMBER#mbc#00000#99999"
},
{
"Name": "custom:roles",
"Value": "[{\"role\":\"system_admin\"}]"
Expand Down Expand Up @@ -248,15 +260,48 @@
"MinValue": "0"
}
},
{
"Name": "custom:tenant_code",
"AttributeDataType": "String",
"DeveloperOnlyAttribute": false,
"Mutable": true,
"Required": false,
"StringAttributeConstraints": {
"MinLength": "0",
"MaxLength": "50"
}
},
{
"Name": "custom:company_code",
"AttributeDataType": "String",
"DeveloperOnlyAttribute": false,
"Mutable": true,
"Required": false,
"StringAttributeConstraints": {
"MinLength": "0",
"MaxLength": "50"
}
},
{
"Name": "custom:member_id",
"AttributeDataType": "String",
"DeveloperOnlyAttribute": false,
"Mutable": true,
"Required": false,
"StringAttributeConstraints": {
"MinLength": "0",
"MaxLength": "2048"
}
},
{
"Name": "custom:roles",
"AttributeDataType": "String",
"DeveloperOnlyAttribute": false,
"Mutable": true,
"Required": false,
"StringAttributeConstraints": {
"MinLength": "1",
"MaxLength": "10"
"MinLength": "0",
"MaxLength": "2048"
}
}
],
Expand Down
9 changes: 3 additions & 6 deletions packages/cli/templates/infra/libs/infra-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export class InfraStack extends cdk.Stack {
mfa: cdk.aws_cognito.Mfa.OFF,
accountRecovery: cdk.aws_cognito.AccountRecovery.NONE,
customAttributes: {
cci_code: new cdk.aws_cognito.StringAttribute({
tenant_code: new cdk.aws_cognito.StringAttribute({
mutable: true,
maxLen: 20,
maxLen: 50,
}),
company_code: new cdk.aws_cognito.StringAttribute({
mutable: true,
Expand All @@ -84,10 +84,7 @@ export class InfraStack extends cdk.Stack {
mutable: true,
maxLen: 2024,
}),
user_type: new cdk.aws_cognito.StringAttribute({
mutable: true,
maxLen: 20,
}),
roles: new cdk.aws_cognito.StringAttribute({ mutable: true }),
},
email: cdk.aws_cognito.UserPoolEmail.withCognito(),
deletionProtection: true,
Expand Down

0 comments on commit 08c335c

Please sign in to comment.