Reputation: 803
I am trying to create a user-pool on cognito using the AWS CLI from a json file. The pool is being created, but I am not able to set some of its properties.
Note: Some of the snapshots attached below are taken from the AWS Docs for creating user pool.
I am not able to find a way to set the Email as a verification attribute.
Snapshot:
The email message and subject is not being customized, eventhough I am specifying them in my json file. This brings me to another question (Point 3).
The AWS documentation for creating a user pool through CLI mentions three properties.
snapshot:
Below is the JSON object that I formed to create the pool
{
"PoolName": "xxx-userpool-local",
"Policies": {
"PasswordPolicy": {
"MinimumLength": 8,
"RequireUppercase": true,
"RequireLowercase": true,
"RequireNumbers": true,
"RequireSymbols": true,
"TemporaryPasswordValidityDays": 7
}
},
"UsernameAttributes": [
"email"
],
"EmailVerificationMessage": "Please click the link below to verify your account. {####}",
"EmailVerificationSubject": "Your account is ready",
"VerificationMessageTemplate": {
"EmailMessage": "Please click the link below to verify your account. {####}",
"EmailSubject": "Your account is ready",
"EmailMessageByLink": "Please click the link below to verify your account. {####}",
"EmailSubjectByLink": "Your account is ready",
"DefaultEmailOption": "CONFIRM_WITH_LINK"
},
"AdminCreateUserConfig": {
"AllowAdminCreateUserOnly": false
},
"UsernameConfiguration": {
"CaseSensitive": true
},
"AccountRecoverySetting": {
"RecoveryMechanisms": [
{
"Priority": 1,
"Name": "verified_email"
}
]
}
}
Upvotes: 1
Views: 276
Reputation: 12259
AutoVerifiedAttributes
in CLI. In order to set the Email as a verification attribute, add the following code snippet to your JSON input:"AutoVerifiedAttributes": [
"email"
]
AdminCreateUserConfig.InviteMessageTemplate
in the CLI."AdminCreateUserConfig": {
"AllowAdminCreateUserOnly": false,
"InviteMessageTemplate": {
"EmailMessage": "Your username is {username} and temporary password is {####}. ",
"EmailSubject": "Your temporary password"
}
}
"VerificationMessageTemplate": {
"EmailMessageByLink": "Please click the link below to verify your email address. {##Verify Email##} ",
"EmailSubjectByLink": "Your verification link",
"DefaultEmailOption": "CONFIRM_WITH_LINK"
}
Upvotes: 2