Skip to content
v2.274.0

UserPool L2 construct ​

Define a Cognito User Pool.

Example ​

ts
const pool = new cognito.UserPool(this, 'Pool');
pool.addClient('app-client', {
  oAuth: {
    flows: {
      authorizationCodeGrant: true,
    },
    scopes: [ cognito.OAuthScope.OPENID ],
    callbackUrls: [ 'https://my-app-domain.com/welcome' ],
    logoutUrls: [ 'https://my-app-domain.com/signin' ],
  },
});
python
pool = cognito.UserPool(self, "Pool")
pool.add_client("app-client",
    o_auth=cognito.OAuthSettings(
        flows=cognito.OAuthFlows(
            authorization_code_grant=True
        ),
        scopes=[cognito.OAuthScope.OPENID],
        callback_urls=["https://my-app-domain.com/welcome"],
        logout_urls=["https://my-app-domain.com/signin"]
    )
)
java
UserPool pool = new UserPool(this, "Pool");
pool.addClient("app-client", UserPoolClientOptions.builder()
        .oAuth(OAuthSettings.builder()
                .flows(OAuthFlows.builder()
                        .authorizationCodeGrant(true)
                        .build())
                .scopes(List.of(OAuthScope.OPENID))
                .callbackUrls(List.of("https://my-app-domain.com/welcome"))
                .logoutUrls(List.of("https://my-app-domain.com/signin"))
                .build())
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
var pool = new UserPool(this, "Pool");
pool.AddClient("app-client", new UserPoolClientOptions {
    OAuth = new OAuthSettings {
        Flows = new OAuthFlows {
            AuthorizationCodeGrant = true
        },
        Scopes = new [] { OAuthScope.OPENID },
        CallbackUrls = new [] { "https://my-app-domain.com/welcome" },
        LogoutUrls = new [] { "https://my-app-domain.com/signin" }
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
pool := cognito.NewUserPool(this, jsii.String("Pool"))
pool.addClient(jsii.String("app-client"), &UserPoolClientOptions{
	OAuth: &OAuthSettings{
		Flows: &OAuthFlows{
			AuthorizationCodeGrant: jsii.Boolean(true),
		},
		Scopes: []OAuthScope{
			cognito.OAuthScope_OPENID(),
		},
		CallbackUrls: []*string{
			jsii.String("https://my-app-domain.com/welcome"),
		},
		LogoutUrls: []*string{
			jsii.String("https://my-app-domain.com/signin"),
		},
	},
})

Initializer ​

ts
new UserPool(scope: Construct, id: string, props?: UserPoolProps)
python
UserPool(scope: Construct, id: str, props: typing.Optional[UserPoolProps] = None)
java
new UserPool(Construct scope, String id, UserPoolProps props)
csharp
new UserPool(Construct scope, string id, UserPoolProps? props = null)
go
NewUserPool(Scope Construct, Id *string, Props UserPoolProps)

Construct Props ​

accountRecoveryoptionalAccountRecoveryaccount_recoveryoptionalAccountRecoveryaccountRecoveryoptionalAccountRecoveryAccountRecoveryoptionalAccountRecoveryAccountRecoveryoptionalAccountRecovery#
How will a user be able to recover their account?

Default: AccountRecovery.PHONE_WITHOUT_MFA_AND_EMAIL

advancedSecurityModeoptionalAdvancedSecurityModeadvanced_security_modeoptionalAdvancedSecurityModeadvancedSecurityModeoptionalAdvancedSecurityModeAdvancedSecurityModeoptionalAdvancedSecurityModeAdvancedSecurityModeoptionalAdvancedSecurityModedeprecated#
Advanced Security Mode is deprecated due to user pool feature plans. Use StandardThreatProtectionMode and CustomThreatProtectionMode to set Thread Protection level.

Default: no value

autoVerifyoptionalAutoVerifiedAttrsauto_verifyoptionalAutoVerifiedAttrsautoVerifyoptionalAutoVerifiedAttrsAutoVerifyoptionalAutoVerifiedAttrsAutoVerifyoptionalAutoVerifiedAttrs#
Attributes which Cognito will look to verify automatically upon user sign up.

Default: If signInAlias includes email and/or phone, they will be included in autoVerifiedAttributes by default. If absent, no attributes will be auto-verified.

EMAIL and PHONE are the only available options.

customAttributesoptional{ [key: string]: ICustomAttribute }custom_attributesoptionaltyping.Mapping[str, ICustomAttribute]customAttributesoptionalMap<String, ICustomAttribute>CustomAttributesoptionalIDictionary<string, ICustomAttribute>CustomAttributesoptional*map[string]ICustomAttribute#
Define a set of custom attributes that can be configured for each user in the user pool.

Default: No custom attributes.

customSenderKmsKeyoptionalIKeyRefcustom_sender_kms_keyoptionalIKeyRefcustomSenderKmsKeyoptionalIKeyRefCustomSenderKmsKeyoptionalIKeyRefCustomSenderKmsKeyoptionalIKeyRef#
This key will be used to encrypt temporary passwords and authorization codes that Amazon Cognito generates.

Default: no key ID configured

customThreatProtectionModeoptionalCustomThreatProtectionModecustom_threat_protection_modeoptionalCustomThreatProtectionModecustomThreatProtectionModeoptionalCustomThreatProtectionModeCustomThreatProtectionModeoptionalCustomThreatProtectionModeCustomThreatProtectionModeoptionalCustomThreatProtectionMode#
The Type of Threat Protection Enabled for Custom Authentication.

Default: no value

This feature only functions if your FeaturePlan is set to FeaturePlan.PLUS

deletionProtectionoptionalbooleandeletion_protectionoptionalbooldeletionProtectionoptionalBooleanDeletionProtectionoptionalboolDeletionProtectionoptional*bool= false#
Indicates whether the user pool should have deletion protection enabled.
deviceTrackingoptionalDeviceTrackingdevice_trackingoptionalDeviceTrackingdeviceTrackingoptionalDeviceTrackingDeviceTrackingoptionalDeviceTrackingDeviceTrackingoptionalDeviceTracking#
Device tracking settings.

Default: see defaults on each property of DeviceTracking.

emailoptionalUserPoolEmailemailoptionalUserPoolEmailemailoptionalUserPoolEmailEmailoptionalUserPoolEmailEmailoptionalUserPoolEmail#
Email settings for a user pool.

Default: cognito will use the default email configuration

enableSmsRoleoptionalbooleanenable_sms_roleoptionalboolenableSmsRoleoptionalBooleanEnableSmsRoleoptionalboolEnableSmsRoleoptional*bool#
Setting this would explicitly enable or disable SMS role creation.

Default: CDK will determine based on other properties of the user pool if an SMS role should be created or not.

When left unspecified, CDK will determine based on other properties if a role is needed or not.

featurePlanoptionalFeaturePlanfeature_planoptionalFeaturePlanfeaturePlanoptionalFeaturePlanFeaturePlanoptionalFeaturePlanFeaturePlanoptionalFeaturePlan#
The user pool feature plan, or tier.

Default: FeaturePlan.ESSENTIALS for a newly created user pool; FeaturePlan.LITE otherwise

This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection.

keepOriginaloptionalKeepOriginalAttrskeep_originaloptionalKeepOriginalAttrskeepOriginaloptionalKeepOriginalAttrsKeepOriginaloptionalKeepOriginalAttrsKeepOriginaloptionalKeepOriginalAttrs#
Attributes which Cognito will look to handle changes to the value of your users' email address and phone number attributes.

Default: Nothing is kept.

EMAIL and PHONE are the only available options.

lambdaTriggersoptionalUserPoolTriggerslambda_triggersoptionalUserPoolTriggerslambdaTriggersoptionalUserPoolTriggersLambdaTriggersoptionalUserPoolTriggersLambdaTriggersoptionalUserPoolTriggers#
Lambda functions to use for supported Cognito triggers.

Default: No Lambda triggers.

mfaoptionalMfamfaoptionalMfamfaoptionalMfaMfaoptionalMfaMfaoptionalMfa= Mfa.OFF#
Configure whether users of this user pool can or are required use MFA to sign in.
mfaMessageoptionalstringmfa_messageoptionalstrmfaMessageoptionalStringMfaMessageoptionalstringMfaMessageoptional*string#
The SMS message template sent during MFA verification.

Default: 'Your authentication code is {####}.'

Use '{####}' in the template where Cognito should insert the verification code.

mfaSecondFactoroptionalMfaSecondFactormfa_second_factoroptionalMfaSecondFactormfaSecondFactoroptionalMfaSecondFactorMfaSecondFactoroptionalMfaSecondFactorMfaSecondFactoroptionalMfaSecondFactor#
Configure the MFA types that users can use in this user pool.

Default: { sms: true, otp: false, email: false }, if mfa is set to OPTIONAL or REQUIRED. { sms: false, otp: false, email:false }, otherwise

Ignored if mfa is set to OFF.

passkeyRelyingPartyIdoptionalstringpasskey_relying_party_idoptionalstrpasskeyRelyingPartyIdoptionalStringPasskeyRelyingPartyIdoptionalstringPasskeyRelyingPartyIdoptional*string#
The authentication domain that passkey providers must use as a relying party (RP) in their configuration.

Default: No authentication domain

notes

Under the following conditions, the passkey relying party ID must be the fully-qualified domain name of your custom domain:

  • The user pool is configured for passkey authentication.
  • The user pool has a custom domain, whether or not it also has a prefix domain.
  • Your application performs authentication with managed login or the classic hosted UI.
passkeyUserVerificationoptionalPasskeyUserVerificationpasskey_user_verificationoptionalPasskeyUserVerificationpasskeyUserVerificationoptionalPasskeyUserVerificationPasskeyUserVerificationoptionalPasskeyUserVerificationPasskeyUserVerificationoptionalPasskeyUserVerification#
Your user-pool treatment for MFA with a passkey.

Default: Cognito default setting is PasskeyUserVerification.PREFERRED

You can override other MFA options and require passkey MFA, or you can set it as preferred. When passkey MFA is preferred, the hosted UI encourages users to register a passkey at sign-in.

passwordPolicyoptionalPasswordPolicypassword_policyoptionalPasswordPolicypasswordPolicyoptionalPasswordPolicyPasswordPolicyoptionalPasswordPolicyPasswordPolicyoptionalPasswordPolicy#
Password policy for this user pool.

Default: see defaults on each property of PasswordPolicy.

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.RETAIN#
Policy to apply when the user pool is removed from the stack.
selfSignUpEnabledoptionalbooleanself_sign_up_enabledoptionalboolselfSignUpEnabledoptionalBooleanSelfSignUpEnabledoptionalboolSelfSignUpEnabledoptional*bool= false#
Whether self sign-up should be enabled.

To configure self sign-up configuration use the userVerification property.

signInAliasesoptionalSignInAliasessign_in_aliasesoptionalSignInAliasessignInAliasesoptionalSignInAliasesSignInAliasesoptionalSignInAliasesSignInAliasesoptionalSignInAliases#
Methods in which a user registers or signs in to a user pool.

Default: { username: true }

notes

Allows either username with aliases OR sign in with email, phone, or both.

Read the sections on usernames and aliases to learn more - https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html

To match with 'Option 1' in the above link, with a verified email, this property should be set to { username: true, email: true }. To match with 'Option 2' in the above link with both a verified email and phone number, this property should be set to { email: true, phone: true }.

signInCaseSensitiveoptionalbooleansign_in_case_sensitiveoptionalboolsignInCaseSensitiveoptionalBooleanSignInCaseSensitiveoptionalboolSignInCaseSensitiveoptional*bool= true#
Whether sign-in aliases should be evaluated with case sensitivity.

For example, when this option is set to false, users will be able to sign in using either MyUsername or myusername.

signInPolicyoptionalSignInPolicysign_in_policyoptionalSignInPolicysignInPolicyoptionalSignInPolicySignInPolicyoptionalSignInPolicySignInPolicyoptionalSignInPolicy#
Sign-in policy for this user pool.

Default: see defaults on each property of SignInPolicy.

smsRoleoptionalIRoleRefsms_roleoptionalIRoleRefsmsRoleoptionalIRoleRefSmsRoleoptionalIRoleRefSmsRoleoptionalIRoleRef#
The IAM role that Cognito will assume while sending SMS messages.

Default: a new IAM role is created.

smsRoleExternalIdoptionalstringsms_role_external_idoptionalstrsmsRoleExternalIdoptionalStringSmsRoleExternalIdoptionalstringSmsRoleExternalIdoptional*string#
The 'ExternalId' that Cognito service must be using when assuming the `smsRole`, if the role is restricted with an 'sts:ExternalId' conditional.

Default: No external id will be configured.

Learn more about ExternalId here - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html

This property will be ignored if smsRole is not specified.

snsRegionoptionalstringsns_regionoptionalstrsnsRegionoptionalStringSnsRegionoptionalstringSnsRegionoptional*string#
The region to integrate with SNS to send SMS messages.

Default: The same region as the user pool, with a few exceptions - https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html#user-pool-sms-settings-first-time

This property will do nothing if SMS configuration is not configured.

standardAttributesoptionalStandardAttributesstandard_attributesoptionalStandardAttributesstandardAttributesoptionalStandardAttributesStandardAttributesoptionalStandardAttributesStandardAttributesoptionalStandardAttributes#
The set of attributes that are required for every user in the user pool.

Default: All standard attributes are optional and mutable.

Read more on attributes here - https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html

standardThreatProtectionModeoptionalStandardThreatProtectionModestandard_threat_protection_modeoptionalStandardThreatProtectionModestandardThreatProtectionModeoptionalStandardThreatProtectionModeStandardThreatProtectionModeoptionalStandardThreatProtectionModeStandardThreatProtectionModeoptionalStandardThreatProtectionMode#
The Type of Threat Protection Enabled for Standard Authentication.

Default: StandardThreatProtectionMode.NO_ENFORCEMENT

This feature only functions if your FeaturePlan is set to FeaturePlan.PLUS

userInvitationoptionalUserInvitationConfiguser_invitationoptionalUserInvitationConfiguserInvitationoptionalUserInvitationConfigUserInvitationoptionalUserInvitationConfigUserInvitationoptionalUserInvitationConfig#
Configuration around admins signing up users into a user pool.

Default: see defaults in UserInvitationConfig.

userPoolNameoptionalstringuser_pool_nameoptionalstruserPoolNameoptionalStringUserPoolNameoptionalstringUserPoolNameoptional*string#
Name of the user pool.

Default: automatically generated name by CloudFormation at deploy time.

userVerificationoptionalUserVerificationConfiguser_verificationoptionalUserVerificationConfiguserVerificationoptionalUserVerificationConfigUserVerificationoptionalUserVerificationConfigUserVerificationoptionalUserVerificationConfig#
Configuration around users signing themselves up to the user pool.

Default: see defaults in UserVerificationConfig.

Enable or disable self sign-up via the selfSignUpEnabled property.

Properties ​

The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

identityProvidersIUserPoolIdentityProvider[]identity_providerstyping.List[IUserPoolIdentityProvider]identityProvidersList<IUserPoolIdentityProvider>IdentityProvidersIUserPoolIdentityProvider[]IdentityProviders*[]IUserPoolIdentityProviderrequired#
Get all identity providers registered with this user pool.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.
userPoolArnstringuser_pool_arnstruserPoolArnStringUserPoolArnstringUserPoolArn*stringrequired#
The ARN of the user pool.
userPoolIdstringuser_pool_idstruserPoolIdStringUserPoolIdstringUserPoolId*stringrequired#
The physical ID of this user pool resource.
userPoolProviderNamestringuser_pool_provider_namestruserPoolProviderNameStringUserPoolProviderNamestringUserPoolProviderName*stringrequired#
User pool provider name.
userPoolProviderUrlstringuser_pool_provider_urlstruserPoolProviderUrlStringUserPoolProviderUrlstringUserPoolProviderUrl*stringrequired#
User pool provider URL.
userPoolRefUserPoolReferenceuser_pool_refUserPoolReferenceuserPoolRefUserPoolReferenceUserPoolRefUserPoolReferenceUserPoolRefUserPoolReferencerequired#
A reference to a UserPool resource.

Methods ​

addClient(id: string, options?: UserPoolClientOptions): UserPoolClientdef add_client(self, id: str, options: typing.Optional[UserPoolClientOptions] = None) -> UserPoolClientpublic UserPoolClient addClient(String id, UserPoolClientOptions options)public UserPoolClient AddClient(string id, UserPoolClientOptions? options = null)func AddClient(Id *string, Options UserPoolClientOptions) UserPoolClient#
Add a new app client to this user pool.
addDomain(id: string, options: UserPoolDomainOptions): UserPoolDomaindef add_domain(self, id: str, options: UserPoolDomainOptions) -> UserPoolDomainpublic UserPoolDomain addDomain(String id, UserPoolDomainOptions options)public UserPoolDomain AddDomain(string id, UserPoolDomainOptions options)func AddDomain(Id *string, Options UserPoolDomainOptions) UserPoolDomain#
Associate a domain to this user pool.
addGroup(id: string, options: UserPoolGroupOptions): UserPoolGroupdef add_group(self, id: str, options: UserPoolGroupOptions) -> UserPoolGrouppublic UserPoolGroup addGroup(String id, UserPoolGroupOptions options)public UserPoolGroup AddGroup(string id, UserPoolGroupOptions options)func AddGroup(Id *string, Options UserPoolGroupOptions) UserPoolGroup#
Add a new group to this user pool.
addResourceServer(id: string, options: UserPoolResourceServerOptions): UserPoolResourceServerdef add_resource_server(self, id: str, options: UserPoolResourceServerOptions) -> UserPoolResourceServerpublic UserPoolResourceServer addResourceServer(String id, UserPoolResourceServerOptions options)public UserPoolResourceServer AddResourceServer(string id, UserPoolResourceServerOptions options)func AddResourceServer(Id *string, Options UserPoolResourceServerOptions) UserPoolResourceServer#
Add a new resource server to this user pool.
addTrigger(operation: UserPoolOperation, fn: IFunction, lambdaVersion?: LambdaVersion): voiddef add_trigger(self, operation: UserPoolOperation, fn: IFunction, lambda_version: typing.Optional[LambdaVersion] = None) -> Nonepublic void addTrigger(UserPoolOperation operation, IFunction fn, LambdaVersion lambdaVersion)public void AddTrigger(UserPoolOperation operation, IFunction fn, LambdaVersion? lambdaVersion = null)func AddTrigger(Operation UserPoolOperation, Fn IFunction, LambdaVersion LambdaVersion)#
Add a lambda trigger to a user pool operation.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

fromUserPoolArn(scope: Construct, id: string, userPoolArn: string): IUserPool@staticmethod def from_user_pool_arn(scope: Construct, id: str, user_pool_arn: str) -> IUserPoolpublic static IUserPool fromUserPoolArn(Construct scope, String id, String userPoolArn)public static IUserPool FromUserPoolArn(Construct scope, string id, string userPoolArn)func FromUserPoolArn(Scope Construct, Id *string, UserPoolArn *string) IUserPoolstatic#
Import an existing user pool based on its ARN.
fromUserPoolId(scope: Construct, id: string, userPoolId: string): IUserPool@staticmethod def from_user_pool_id(scope: Construct, id: str, user_pool_id: str) -> IUserPoolpublic static IUserPool fromUserPoolId(Construct scope, String id, String userPoolId)public static IUserPool FromUserPoolId(Construct scope, string id, string userPoolId)func FromUserPoolId(Scope Construct, Id *string, UserPoolId *string) IUserPoolstatic#
Import an existing user pool based on its id.
grant(grantee: IGrantable, ...actions: string[]): Grantdef grant(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grant(IGrantable grantee, String actions)public Grant Grant(IGrantable grantee, string actions)func Grant(Grantee IGrantable, Actions *string) Grant#
[disable-awslint:no-grants].
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
registerIdentityProvider(provider: IUserPoolIdentityProviderRef): voiddef register_identity_provider(self, provider: IUserPoolIdentityProviderRef) -> Nonepublic void registerIdentityProvider(IUserPoolIdentityProviderRef provider)public void RegisterIdentityProvider(IUserPoolIdentityProviderRef provider)func RegisterIdentityProvider(Provider IUserPoolIdentityProviderRef)#
Register an identity provider with this user pool.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.