StandardAttributes Struct
The set of standard attributes that can be marked as required or mutable.
| Source | aws-cognito/lib/user-pool-attr.ts |
|---|
Example
new cognito.UserPool(this, 'myuserpool', {
// ...
standardAttributes: {
fullname: {
required: true,
mutable: false,
},
address: {
required: false,
mutable: true,
},
},
customAttributes: {
'myappid': new cognito.StringAttribute({ minLen: 5, maxLen: 15, mutable: false }),
'callingcode': new cognito.NumberAttribute({ min: 1, max: 3, mutable: true }),
'isEmployee': new cognito.BooleanAttribute({ mutable: true }),
'joinedOn': new cognito.DateTimeAttribute(),
},
});
cognito.UserPool(self, "myuserpool",
# ...
standard_attributes=cognito.StandardAttributes(
fullname=cognito.StandardAttribute(
required=True,
mutable=False
),
address=cognito.StandardAttribute(
required=False,
mutable=True
)
),
custom_attributes={
"myappid": cognito.StringAttribute(min_len=5, max_len=15, mutable=False),
"callingcode": cognito.NumberAttribute(min=1, max=3, mutable=True),
"isEmployee": cognito.BooleanAttribute(mutable=True),
"joinedOn": cognito.DateTimeAttribute()
}
)
UserPool.Builder.create(this, "myuserpool")
// ...
.standardAttributes(StandardAttributes.builder()
.fullname(StandardAttribute.builder()
.required(true)
.mutable(false)
.build())
.address(StandardAttribute.builder()
.required(false)
.mutable(true)
.build())
.build())
.customAttributes(Map.of(
"myappid", StringAttribute.Builder.create().minLen(5).maxLen(15).mutable(false).build(),
"callingcode", NumberAttribute.Builder.create().min(1).max(3).mutable(true).build(),
"isEmployee", BooleanAttribute.Builder.create().mutable(true).build(),
"joinedOn", new DateTimeAttribute()))
.build();
// Install: dotnet add package Amazon.CDK.Lib
new UserPool(this, "myuserpool", new UserPoolProps {
// ...
StandardAttributes = new StandardAttributes {
Fullname = new StandardAttribute {
Required = true,
Mutable = false
},
Address = new StandardAttribute {
Required = false,
Mutable = true
}
},
CustomAttributes = new Dictionary<string, ICustomAttribute> {
{ "myappid", new StringAttribute(new StringAttributeProps { MinLen = 5, MaxLen = 15, Mutable = false }) },
{ "callingcode", new NumberAttribute(new NumberAttributeProps { Min = 1, Max = 3, Mutable = true }) },
{ "isEmployee", new BooleanAttribute(new CustomAttributeProps { Mutable = true }) },
{ "joinedOn", new DateTimeAttribute() }
}
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
cognito.NewUserPool(this, jsii.String("myuserpool"), &UserPoolProps{
// ...
StandardAttributes: &StandardAttributes{
Fullname: &StandardAttribute{
Required: jsii.Boolean(true),
Mutable: jsii.Boolean(false),
},
Address: &StandardAttribute{
Required: jsii.Boolean(false),
Mutable: jsii.Boolean(true),
},
},
CustomAttributes: map[string]ICustomAttribute{
"myappid": cognito.NewStringAttribute(&StringAttributeProps{
"minLen": jsii.Number(5),
"maxLen": jsii.Number(15),
"mutable": jsii.Boolean(false),
}),
"callingcode": cognito.NewNumberAttribute(&NumberAttributeProps{
"min": jsii.Number(1),
"max": jsii.Number(3),
"mutable": jsii.Boolean(true),
}),
"isEmployee": cognito.NewBooleanAttribute(&CustomAttributeProps{
"mutable": jsii.Boolean(true),
}),
"joinedOn": cognito.NewDateTimeAttribute(),
},
})
Properties
addressoptionalStandardAttributeaddressoptionalStandardAttributeaddressoptionalStandardAttributeAddressoptionalStandardAttributeAddressoptionalStandardAttribute #Default: see the defaults under StandardAttribute
birthdateoptionalStandardAttributebirthdateoptionalStandardAttributebirthdateoptionalStandardAttributeBirthdateoptionalStandardAttributeBirthdateoptionalStandardAttribute #Default: see the defaults under StandardAttribute
emailoptionalStandardAttributeemailoptionalStandardAttributeemailoptionalStandardAttributeEmailoptionalStandardAttributeEmailoptionalStandardAttribute #Default: see the defaults under StandardAttribute
familyNameoptionalStandardAttributefamily_nameoptionalStandardAttributefamilyNameoptionalStandardAttributeFamilyNameoptionalStandardAttributeFamilyNameoptionalStandardAttribute #Default: see the defaults under StandardAttribute
fullnameoptionalStandardAttributefullnameoptionalStandardAttributefullnameoptionalStandardAttributeFullnameoptionalStandardAttributeFullnameoptionalStandardAttribute #Default: see the defaults under StandardAttribute
genderoptionalStandardAttributegenderoptionalStandardAttributegenderoptionalStandardAttributeGenderoptionalStandardAttributeGenderoptionalStandardAttribute #Default: see the defaults under StandardAttribute
givenNameoptionalStandardAttributegiven_nameoptionalStandardAttributegivenNameoptionalStandardAttributeGivenNameoptionalStandardAttributeGivenNameoptionalStandardAttribute #Default: see the defaults under StandardAttribute
lastUpdateTimeoptionalStandardAttributelast_update_timeoptionalStandardAttributelastUpdateTimeoptionalStandardAttributeLastUpdateTimeoptionalStandardAttributeLastUpdateTimeoptionalStandardAttribute #Default: see the defaults under StandardAttribute
localeoptionalStandardAttributelocaleoptionalStandardAttributelocaleoptionalStandardAttributeLocaleoptionalStandardAttributeLocaleoptionalStandardAttribute #Default: see the defaults under StandardAttribute
middleNameoptionalStandardAttributemiddle_nameoptionalStandardAttributemiddleNameoptionalStandardAttributeMiddleNameoptionalStandardAttributeMiddleNameoptionalStandardAttribute #Default: see the defaults under StandardAttribute
nicknameoptionalStandardAttributenicknameoptionalStandardAttributenicknameoptionalStandardAttributeNicknameoptionalStandardAttributeNicknameoptionalStandardAttribute #Default: see the defaults under StandardAttribute
phoneNumberoptionalStandardAttributephone_numberoptionalStandardAttributephoneNumberoptionalStandardAttributePhoneNumberoptionalStandardAttributePhoneNumberoptionalStandardAttribute #Default: see the defaults under StandardAttribute
preferredUsernameoptionalStandardAttributepreferred_usernameoptionalStandardAttributepreferredUsernameoptionalStandardAttributePreferredUsernameoptionalStandardAttributePreferredUsernameoptionalStandardAttribute #Default: see the defaults under StandardAttribute
profilePageoptionalStandardAttributeprofile_pageoptionalStandardAttributeprofilePageoptionalStandardAttributeProfilePageoptionalStandardAttributeProfilePageoptionalStandardAttribute #Default: see the defaults under StandardAttribute
profilePictureoptionalStandardAttributeprofile_pictureoptionalStandardAttributeprofilePictureoptionalStandardAttributeProfilePictureoptionalStandardAttributeProfilePictureoptionalStandardAttribute #Default: see the defaults under StandardAttribute
timezoneoptionalStandardAttributetimezoneoptionalStandardAttributetimezoneoptionalStandardAttributeTimezoneoptionalStandardAttributeTimezoneoptionalStandardAttribute #Default: see the defaults under StandardAttribute
websiteoptionalStandardAttributewebsiteoptionalStandardAttributewebsiteoptionalStandardAttributeWebsiteoptionalStandardAttributeWebsiteoptionalStandardAttribute #Default: see the defaults under StandardAttribute