aws-cdk-lib.aws_cognito.ClientAttributes

class ClientAttributes

LanguageType name
.NETAmazon.CDK.AWS.Cognito.ClientAttributes
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscognito#ClientAttributes
Javasoftware.amazon.awscdk.services.cognito.ClientAttributes
Pythonaws_cdk.aws_cognito.ClientAttributes
TypeScript (source)aws-cdk-lib » aws_cognito » ClientAttributes

A set of attributes, useful to set Read and Write attributes.

Example

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

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

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

pool.addClient('app-client', {
  // ...
  readAttributes: clientReadAttributes,
  writeAttributes: clientWriteAttributes,
});

Initializer

new ClientAttributes()

Creates a ClientAttributes with the specified attributes.

Methods

NameDescription
attributes()The list of attributes represented by this ClientAttributes.
withCustomAttributes(...attributes)Creates a custom ClientAttributes with the specified attributes.
withStandardAttributes(attributes)Creates a custom ClientAttributes with the specified attributes.

attributes()

public attributes(): string[]

Returns

  • string[]

The list of attributes represented by this ClientAttributes.


withCustomAttributes(...attributes)

public withCustomAttributes(...attributes: string[]): ClientAttributes

Parameters

  • attributes string — a list of custom attributes to add to the set.

Returns

  • ClientAttributes

Creates a custom ClientAttributes with the specified attributes.


withStandardAttributes(attributes)

public withStandardAttributes(attributes: StandardAttributesMask): ClientAttributes

Parameters

  • attributes StandardAttributesMask — a list of standard attributes to add to the set.

Returns

  • ClientAttributes

Creates a custom ClientAttributes with the specified attributes.