Class CfnUserPool
A CloudFormation AWS::Cognito::UserPool
.
Inherited Members
Namespace: Amazon.CDK.AWS.Cognito
Assembly: Amazon.CDK.AWS.Cognito.dll
Syntax (csharp)
public class CfnUserPool : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnUserPool
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::Cognito::UserPool
resource creates an Amazon Cognito user pool. For more information on working with Amazon Cognito user pools, see Amazon Cognito User Pools and CreateUserPool .
If you don't specify a value for a parameter, Amazon Cognito sets it to a default value.
CloudformationResource: AWS::Cognito::UserPool
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Cognito;
var userPoolTags;
var cfnUserPool = new CfnUserPool(this, "MyCfnUserPool", new CfnUserPoolProps {
AccountRecoverySetting = new AccountRecoverySettingProperty {
RecoveryMechanisms = new [] { new RecoveryOptionProperty {
Name = "name",
Priority = 123
} }
},
AdminCreateUserConfig = new AdminCreateUserConfigProperty {
AllowAdminCreateUserOnly = false,
InviteMessageTemplate = new InviteMessageTemplateProperty {
EmailMessage = "emailMessage",
EmailSubject = "emailSubject",
SmsMessage = "smsMessage"
},
UnusedAccountValidityDays = 123
},
AliasAttributes = new [] { "aliasAttributes" },
AutoVerifiedAttributes = new [] { "autoVerifiedAttributes" },
DeletionProtection = "deletionProtection",
DeviceConfiguration = new DeviceConfigurationProperty {
ChallengeRequiredOnNewDevice = false,
DeviceOnlyRememberedOnUserPrompt = false
},
EmailConfiguration = new EmailConfigurationProperty {
ConfigurationSet = "configurationSet",
EmailSendingAccount = "emailSendingAccount",
From = "from",
ReplyToEmailAddress = "replyToEmailAddress",
SourceArn = "sourceArn"
},
EmailVerificationMessage = "emailVerificationMessage",
EmailVerificationSubject = "emailVerificationSubject",
EnabledMfas = new [] { "enabledMfas" },
LambdaConfig = new LambdaConfigProperty {
CreateAuthChallenge = "createAuthChallenge",
CustomEmailSender = new CustomEmailSenderProperty {
LambdaArn = "lambdaArn",
LambdaVersion = "lambdaVersion"
},
CustomMessage = "customMessage",
CustomSmsSender = new CustomSMSSenderProperty {
LambdaArn = "lambdaArn",
LambdaVersion = "lambdaVersion"
},
DefineAuthChallenge = "defineAuthChallenge",
KmsKeyId = "kmsKeyId",
PostAuthentication = "postAuthentication",
PostConfirmation = "postConfirmation",
PreAuthentication = "preAuthentication",
PreSignUp = "preSignUp",
PreTokenGeneration = "preTokenGeneration",
UserMigration = "userMigration",
VerifyAuthChallengeResponse = "verifyAuthChallengeResponse"
},
MfaConfiguration = "mfaConfiguration",
Policies = new PoliciesProperty {
PasswordPolicy = new PasswordPolicyProperty {
MinimumLength = 123,
RequireLowercase = false,
RequireNumbers = false,
RequireSymbols = false,
RequireUppercase = false,
TemporaryPasswordValidityDays = 123
}
},
Schema = new [] { new SchemaAttributeProperty {
AttributeDataType = "attributeDataType",
DeveloperOnlyAttribute = false,
Mutable = false,
Name = "name",
NumberAttributeConstraints = new NumberAttributeConstraintsProperty {
MaxValue = "maxValue",
MinValue = "minValue"
},
Required = false,
StringAttributeConstraints = new StringAttributeConstraintsProperty {
MaxLength = "maxLength",
MinLength = "minLength"
}
} },
SmsAuthenticationMessage = "smsAuthenticationMessage",
SmsConfiguration = new SmsConfigurationProperty {
ExternalId = "externalId",
SnsCallerArn = "snsCallerArn",
SnsRegion = "snsRegion"
},
SmsVerificationMessage = "smsVerificationMessage",
UserAttributeUpdateSettings = new UserAttributeUpdateSettingsProperty {
AttributesRequireVerificationBeforeUpdate = new [] { "attributesRequireVerificationBeforeUpdate" }
},
UsernameAttributes = new [] { "usernameAttributes" },
UsernameConfiguration = new UsernameConfigurationProperty {
CaseSensitive = false
},
UserPoolAddOns = new UserPoolAddOnsProperty {
AdvancedSecurityMode = "advancedSecurityMode"
},
UserPoolName = "userPoolName",
UserPoolTags = userPoolTags,
VerificationMessageTemplate = new VerificationMessageTemplateProperty {
DefaultEmailOption = "defaultEmailOption",
EmailMessage = "emailMessage",
EmailMessageByLink = "emailMessageByLink",
EmailSubject = "emailSubject",
EmailSubjectByLink = "emailSubjectByLink",
SmsMessage = "smsMessage"
}
});
Synopsis
Constructors
CfnUserPool(Construct, String, ICfnUserPoolProps) | Create a new |
CfnUserPool(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnUserPool(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AccountRecoverySetting | Use this setting to define which verified available method a user can use to recover their password when they call |
AdminCreateUserConfig | The configuration for creating a new user profile. |
AliasAttributes | Attributes supported as an alias for this user pool. Possible values: phone_number , email , or preferred_username . |
AttrArn | The Amazon Resource Name (ARN) of the user pool, such as |
AttrProviderName | The provider name of the Amazon Cognito user pool, specified as a |
AttrProviderUrl | The URL of the provider of the Amazon Cognito user pool, specified as a |
AutoVerifiedAttributes | The attributes to be auto-verified. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
DeletionProtection | When active, |
DeviceConfiguration | The device-remembering configuration for a user pool. |
EmailConfiguration | The email configuration of your user pool. |
EmailVerificationMessage | This parameter is no longer used. |
EmailVerificationSubject | This parameter is no longer used. |
EnabledMfas | Enables MFA on a specified user pool. |
LambdaConfig | The Lambda trigger configuration information for the new user pool. |
MfaConfiguration | The multi-factor authentication (MFA) configuration. Valid values include:. |
Policies | The policy associated with a user pool. |
Schema | The schema attributes for the new user pool. These attributes can be standard or custom attributes. |
SmsAuthenticationMessage | A string representing the SMS authentication message. |
SmsConfiguration | The SMS configuration with the settings that your Amazon Cognito user pool must use to send an SMS message from your AWS account through Amazon Simple Notification Service. |
SmsVerificationMessage | This parameter is no longer used. |
Tags | The tag keys and values to assign to the user pool. |
UserAttributeUpdateSettings | The settings for updates to user attributes. |
UsernameAttributes | Determines whether email addresses or phone numbers can be specified as user names when a user signs up. |
UsernameConfiguration | You can choose to set case sensitivity on the username input for the selected sign-in option. |
UserPoolAddOns | Enables advanced security risk detection. |
UserPoolName | A string used to name the user pool. |
VerificationMessageTemplate | The template for the verification message that the user sees when the app requests permission to access the user's information. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnUserPool(Construct, String, ICfnUserPoolProps)
Create a new AWS::Cognito::UserPool
.
public CfnUserPool(Construct scope, string id, ICfnUserPoolProps props = null)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnUserPoolProps
- resource properties.
CfnUserPool(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnUserPool(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnUserPool(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnUserPool(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AccountRecoverySetting
Use this setting to define which verified available method a user can use to recover their password when they call ForgotPassword
.
public virtual object AccountRecoverySetting { get; set; }
Property Value
System.Object
Remarks
It allows you to define a preferred method when a user has more than one method available. With this setting, SMS does not qualify for a valid password recovery mechanism if the user also has SMS MFA enabled. In the absence of this setting, Cognito uses the legacy behavior to determine the recovery method where SMS is preferred over email.
AdminCreateUserConfig
The configuration for creating a new user profile.
public virtual object AdminCreateUserConfig { get; set; }
Property Value
System.Object
Remarks
AliasAttributes
Attributes supported as an alias for this user pool. Possible values: phone_number , email , or preferred_username .
public virtual string[] AliasAttributes { get; set; }
Property Value
System.String[]
Remarks
This user pool property cannot be updated.
AttrArn
The Amazon Resource Name (ARN) of the user pool, such as arn:aws:cognito-idp:us-east-1:123412341234:userpool/us-east-1_123412341
.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Arn
AttrProviderName
The provider name of the Amazon Cognito user pool, specified as a String
.
public virtual string AttrProviderName { get; }
Property Value
System.String
Remarks
CloudformationAttribute: ProviderName
AttrProviderUrl
The URL of the provider of the Amazon Cognito user pool, specified as a String
.
public virtual string AttrProviderUrl { get; }
Property Value
System.String
Remarks
CloudformationAttribute: ProviderURL
AutoVerifiedAttributes
The attributes to be auto-verified.
public virtual string[] AutoVerifiedAttributes { get; set; }
Property Value
System.String[]
Remarks
Possible values: email , phone_number .
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
DeletionProtection
When active, DeletionProtection
prevents accidental deletion of your user pool.
public virtual string DeletionProtection { get; set; }
Property Value
System.String
Remarks
Before you can delete a user pool that you have protected against deletion, you must deactivate this feature.
When you try to delete a protected user pool in a DeleteUserPool
API request, Amazon Cognito returns an InvalidParameterException
error. To delete a protected user pool, send a new DeleteUserPool
request after you deactivate deletion protection in an UpdateUserPool
API request.
DeviceConfiguration
The device-remembering configuration for a user pool.
public virtual object DeviceConfiguration { get; set; }
Property Value
System.Object
Remarks
A null value indicates that you have deactivated device remembering in your user pool.
When you provide a value for any DeviceConfiguration
field, you activate the Amazon Cognito device-remembering feature.
EmailConfiguration
The email configuration of your user pool.
public virtual object EmailConfiguration { get; set; }
Property Value
System.Object
Remarks
The email configuration type sets your preferred sending method, AWS Region, and sender for messages from your user pool.
EmailVerificationMessage
This parameter is no longer used.
public virtual string EmailVerificationMessage { get; set; }
Property Value
System.String
Remarks
EmailVerificationSubject
This parameter is no longer used.
public virtual string EmailVerificationSubject { get; set; }
Property Value
System.String
Remarks
EnabledMfas
Enables MFA on a specified user pool.
public virtual string[] EnabledMfas { get; set; }
Property Value
System.String[]
Remarks
To disable all MFAs after it has been enabled, set MfaConfiguration to “OFF” and remove EnabledMfas. MFAs can only be all disabled if MfaConfiguration is OFF. Once SMS_MFA is enabled, SMS_MFA can only be disabled by setting MfaConfiguration to “OFF”. Can be one of the following values:
Allowed values: SMS_MFA
| SOFTWARE_TOKEN_MFA
LambdaConfig
The Lambda trigger configuration information for the new user pool.
public virtual object LambdaConfig { get; set; }
Property Value
System.Object
Remarks
In a push model, event sources (such as Amazon S3 and custom applications) need permission to invoke a function. So you must make an extra call to add permission for these event sources to invoke your Lambda function.
For more information on using the Lambda API to add permission, see AddPermission .
For adding permission using the AWS CLI , see add-permission .
MfaConfiguration
The multi-factor authentication (MFA) configuration. Valid values include:.
public virtual string MfaConfiguration { get; set; }
Property Value
System.String
Remarks
Policies
The policy associated with a user pool.
public virtual object Policies { get; set; }
Property Value
System.Object
Remarks
Schema
The schema attributes for the new user pool. These attributes can be standard or custom attributes.
public virtual object Schema { get; set; }
Property Value
System.Object
Remarks
During a user pool update, you can add new schema attributes but you cannot modify or delete an existing schema attribute.
SmsAuthenticationMessage
A string representing the SMS authentication message.
public virtual string SmsAuthenticationMessage { get; set; }
Property Value
System.String
Remarks
SmsConfiguration
The SMS configuration with the settings that your Amazon Cognito user pool must use to send an SMS message from your AWS account through Amazon Simple Notification Service.
public virtual object SmsConfiguration { get; set; }
Property Value
System.Object
Remarks
To send SMS messages with Amazon SNS in the AWS Region that you want, the Amazon Cognito user pool uses an AWS Identity and Access Management (IAM) role in your AWS account .
SmsVerificationMessage
This parameter is no longer used.
public virtual string SmsVerificationMessage { get; set; }
Property Value
System.String
Remarks
Tags
The tag keys and values to assign to the user pool.
public virtual TagManager Tags { get; }
Property Value
Remarks
A tag is a label that you can use to categorize and manage user pools in different ways, such as by purpose, owner, environment, or other criteria.
UserAttributeUpdateSettings
The settings for updates to user attributes.
public virtual object UserAttributeUpdateSettings { get; set; }
Property Value
System.Object
Remarks
These settings include the property AttributesRequireVerificationBeforeUpdate
,
a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For
more information, see Verifying updates to email addresses and phone numbers .
UsernameAttributes
Determines whether email addresses or phone numbers can be specified as user names when a user signs up.
public virtual string[] UsernameAttributes { get; set; }
Property Value
System.String[]
Remarks
Possible values: phone_number
or email
.
This user pool property cannot be updated.
UsernameConfiguration
You can choose to set case sensitivity on the username input for the selected sign-in option.
public virtual object UsernameConfiguration { get; set; }
Property Value
System.Object
Remarks
For example, when this is set to False
, users will be able to sign in using either "username" or "Username". This configuration is immutable once it has been set.
UserPoolAddOns
Enables advanced security risk detection.
public virtual object UserPoolAddOns { get; set; }
Property Value
System.Object
Remarks
Set the key AdvancedSecurityMode
to the value "AUDIT".
UserPoolName
A string used to name the user pool.
public virtual string UserPoolName { get; set; }
Property Value
System.String
Remarks
VerificationMessageTemplate
The template for the verification message that the user sees when the app requests permission to access the user's information.
public virtual object VerificationMessageTemplate { get; set; }
Property Value
System.Object
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>