Skip to content
v2.278.0

StandardAttributesMask Struct ​

This interface contains standard attributes recognized by Cognito from https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html including built-in attributes email_verified and phone_number_verified.

Example ​

ts
const pool = new cognito.UserPool(this, 'Pool');

const clientWriteAttributes = (new cognito.ClientAttributes())
  .withStandardAttributes({fullname: true, email: true})
  .withCustomAttributes('favoritePizza', 'favoriteBeverage');

const clientReadAttributes = clientWriteAttributes
  .withStandardAttributes({emailVerified: true})
  .withCustomAttributes('pointsEarned');

pool.addClient('app-client', {
  // ...
  readAttributes: clientReadAttributes,
  writeAttributes: clientWriteAttributes,
});
python
pool = cognito.UserPool(self, "Pool")

client_write_attributes = (cognito.ClientAttributes()).with_standard_attributes(fullname=True, email=True).with_custom_attributes("favoritePizza", "favoriteBeverage")

client_read_attributes = client_write_attributes.with_standard_attributes(email_verified=True).with_custom_attributes("pointsEarned")

pool.add_client("app-client",
    # ...
    read_attributes=client_read_attributes,
    write_attributes=client_write_attributes
)
java
UserPool pool = new UserPool(this, "Pool");

ClientAttributes clientWriteAttributes = (new ClientAttributes()).withStandardAttributes(StandardAttributesMask.builder().fullname(true).email(true).build()).withCustomAttributes("favoritePizza", "favoriteBeverage");

ClientAttributes clientReadAttributes = clientWriteAttributes.withStandardAttributes(StandardAttributesMask.builder().emailVerified(true).build()).withCustomAttributes("pointsEarned");

pool.addClient("app-client", UserPoolClientOptions.builder()
        // ...
        .readAttributes(clientReadAttributes)
        .writeAttributes(clientWriteAttributes)
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
var pool = new UserPool(this, "Pool");

var clientWriteAttributes = (new ClientAttributes()).WithStandardAttributes(new StandardAttributesMask { Fullname = true, Email = true }).WithCustomAttributes("favoritePizza", "favoriteBeverage");

var clientReadAttributes = clientWriteAttributes.WithStandardAttributes(new StandardAttributesMask { EmailVerified = true }).WithCustomAttributes("pointsEarned");

pool.AddClient("app-client", new UserPoolClientOptions {
    // ...
    ReadAttributes = clientReadAttributes,
    WriteAttributes = clientWriteAttributes
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
pool := cognito.NewUserPool(this, jsii.String("Pool"))

clientWriteAttributes := (cognito.NewClientAttributes()).WithStandardAttributes(&StandardAttributesMask{
	Fullname: jsii.Boolean(true),
	Email: jsii.Boolean(true),
}).WithCustomAttributes(jsii.String("favoritePizza"), jsii.String("favoriteBeverage"))

clientReadAttributes := clientWriteAttributes.WithStandardAttributes(&StandardAttributesMask{
	EmailVerified: jsii.Boolean(true),
}).WithCustomAttributes(jsii.String("pointsEarned"))

pool.addClient(jsii.String("app-client"), &UserPoolClientOptions{
	// ...
	ReadAttributes: clientReadAttributes,
	WriteAttributes: clientWriteAttributes,
})

Properties ​

addressoptionalbooleanaddressoptionalbooladdressoptionalBooleanAddressoptionalboolAddressoptional*bool = false #
The user's postal address.
birthdateoptionalbooleanbirthdateoptionalboolbirthdateoptionalBooleanBirthdateoptionalboolBirthdateoptional*bool = false #
The user's birthday, represented as an ISO 8601:2004 format.
emailoptionalbooleanemailoptionalboolemailoptionalBooleanEmailoptionalboolEmailoptional*bool = false #
The user's e-mail address, represented as an RFC 5322 [RFC5322] addr-spec.
emailVerifiedoptionalbooleanemail_verifiedoptionalboolemailVerifiedoptionalBooleanEmailVerifiedoptionalboolEmailVerifiedoptional*bool = false #
Whether the email address has been verified.
familyNameoptionalbooleanfamily_nameoptionalboolfamilyNameoptionalBooleanFamilyNameoptionalboolFamilyNameoptional*bool = false #
The surname or last name of the user.
fullnameoptionalbooleanfullnameoptionalboolfullnameoptionalBooleanFullnameoptionalboolFullnameoptional*bool = false #
The user's full name in displayable form, including all name parts, titles and suffixes.
genderoptionalbooleangenderoptionalboolgenderoptionalBooleanGenderoptionalboolGenderoptional*bool = false #
The user's gender.
givenNameoptionalbooleangiven_nameoptionalboolgivenNameoptionalBooleanGivenNameoptionalboolGivenNameoptional*bool = false #
The user's first name or give name.
lastUpdateTimeoptionalbooleanlast_update_timeoptionalboollastUpdateTimeoptionalBooleanLastUpdateTimeoptionalboolLastUpdateTimeoptional*bool = false #
The time, the user's information was last updated.
localeoptionalbooleanlocaleoptionalboollocaleoptionalBooleanLocaleoptionalboolLocaleoptional*bool = false #
The user's locale, represented as a BCP47 [RFC5646] language tag.
middleNameoptionalbooleanmiddle_nameoptionalboolmiddleNameoptionalBooleanMiddleNameoptionalboolMiddleNameoptional*bool = false #
The user's middle name.
nicknameoptionalbooleannicknameoptionalboolnicknameoptionalBooleanNicknameoptionalboolNicknameoptional*bool = false #
The user's nickname or casual name.
phoneNumberoptionalbooleanphone_numberoptionalboolphoneNumberoptionalBooleanPhoneNumberoptionalboolPhoneNumberoptional*bool = false #
The user's telephone number.
phoneNumberVerifiedoptionalbooleanphone_number_verifiedoptionalboolphoneNumberVerifiedoptionalBooleanPhoneNumberVerifiedoptionalboolPhoneNumberVerifiedoptional*bool = false #
Whether the phone number has been verified.
preferredUsernameoptionalbooleanpreferred_usernameoptionalboolpreferredUsernameoptionalBooleanPreferredUsernameoptionalboolPreferredUsernameoptional*bool = false #
The user's preferred username, different from the immutable user name.
profilePageoptionalbooleanprofile_pageoptionalboolprofilePageoptionalBooleanProfilePageoptionalboolProfilePageoptional*bool = false #
The URL to the user's profile page.
profilePictureoptionalbooleanprofile_pictureoptionalboolprofilePictureoptionalBooleanProfilePictureoptionalboolProfilePictureoptional*bool = false #
The URL to the user's profile picture.
timezoneoptionalbooleantimezoneoptionalbooltimezoneoptionalBooleanTimezoneoptionalboolTimezoneoptional*bool = false #
The user's time zone.
websiteoptionalbooleanwebsiteoptionalboolwebsiteoptionalBooleanWebsiteoptionalboolWebsiteoptional*bool = false #
The URL to the user's web page or blog.