Skip to main content

user_pools

Creates, updates, deletes or gets an user_pool resource or lists user_pools in a region

Overview

Nameuser_pools
TypeResource
DescriptionResource Type definition for AWS::Cognito::UserPool
Idaws.cognito.user_pools

Fields

NameDatatypeDescription
user_pool_namestring
policiesobject
account_recovery_settingobject
admin_create_user_configobject
alias_attributesarray
username_attributesarray
auto_verified_attributesarray
device_configurationobject
email_configurationobject
email_verification_messagestring
email_verification_subjectstring
deletion_protectionstring
lambda_configobject
mfa_configurationstring
enabled_mfasarray
sms_authentication_messagestring
sms_configurationobject
sms_verification_messagestring
schemaarray
username_configurationobject
user_attribute_update_settingsobject
user_pool_tagsobject
verification_message_templateobject
user_pool_add_onsobject
provider_namestring
provider_urlstring
arnstring
user_pool_idstring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all user_pools in a region.

SELECT
region,
user_pool_name,
policies,
account_recovery_setting,
admin_create_user_config,
alias_attributes,
username_attributes,
auto_verified_attributes,
device_configuration,
email_configuration,
email_verification_message,
email_verification_subject,
deletion_protection,
lambda_config,
mfa_configuration,
enabled_mfas,
sms_authentication_message,
sms_configuration,
sms_verification_message,
schema,
username_configuration,
user_attribute_update_settings,
user_pool_tags,
verification_message_template,
user_pool_add_ons,
provider_name,
provider_url,
arn,
user_pool_id
FROM aws.cognito.user_pools
WHERE region = 'us-east-1';

Gets all properties from an individual user_pool.

SELECT
region,
user_pool_name,
policies,
account_recovery_setting,
admin_create_user_config,
alias_attributes,
username_attributes,
auto_verified_attributes,
device_configuration,
email_configuration,
email_verification_message,
email_verification_subject,
deletion_protection,
lambda_config,
mfa_configuration,
enabled_mfas,
sms_authentication_message,
sms_configuration,
sms_verification_message,
schema,
username_configuration,
user_attribute_update_settings,
user_pool_tags,
verification_message_template,
user_pool_add_ons,
provider_name,
provider_url,
arn,
user_pool_id
FROM aws.cognito.user_pools
WHERE region = 'us-east-1' AND data__Identifier = '<UserPoolId>';

INSERT example

Use the following StackQL query and manifest file to create a new user_pool resource, using stack-deploy.

/*+ create */
INSERT INTO aws.cognito.user_pools (
UserPoolName,
Policies,
AccountRecoverySetting,
AdminCreateUserConfig,
AliasAttributes,
UsernameAttributes,
AutoVerifiedAttributes,
DeviceConfiguration,
EmailConfiguration,
EmailVerificationMessage,
EmailVerificationSubject,
DeletionProtection,
LambdaConfig,
MfaConfiguration,
EnabledMfas,
SmsAuthenticationMessage,
SmsConfiguration,
SmsVerificationMessage,
Schema,
UsernameConfiguration,
UserAttributeUpdateSettings,
UserPoolTags,
VerificationMessageTemplate,
UserPoolAddOns,
region
)
SELECT
'{{ UserPoolName }}',
'{{ Policies }}',
'{{ AccountRecoverySetting }}',
'{{ AdminCreateUserConfig }}',
'{{ AliasAttributes }}',
'{{ UsernameAttributes }}',
'{{ AutoVerifiedAttributes }}',
'{{ DeviceConfiguration }}',
'{{ EmailConfiguration }}',
'{{ EmailVerificationMessage }}',
'{{ EmailVerificationSubject }}',
'{{ DeletionProtection }}',
'{{ LambdaConfig }}',
'{{ MfaConfiguration }}',
'{{ EnabledMfas }}',
'{{ SmsAuthenticationMessage }}',
'{{ SmsConfiguration }}',
'{{ SmsVerificationMessage }}',
'{{ Schema }}',
'{{ UsernameConfiguration }}',
'{{ UserAttributeUpdateSettings }}',
'{{ UserPoolTags }}',
'{{ VerificationMessageTemplate }}',
'{{ UserPoolAddOns }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.cognito.user_pools
WHERE data__Identifier = '<UserPoolId>'
AND region = 'us-east-1';

Permissions

To operate on the user_pools resource, the following permissions are required:

Create

cognito-idp:CreateUserPool,
iam:PassRole,
cognito-idp:SetUserPoolMfaConfig,
cognito-idp:DescribeUserPool,
kms:CreateGrant,
iam:CreateServiceLinkedRole

Read

cognito-idp:DescribeUserPool

Update

cognito-idp:UpdateUserPool,
cognito-idp:ListTagsForResource,
cognito-idp:UntagResource,
cognito-idp:TagResource,
cognito-idp:SetUserPoolMfaConfig,
cognito-idp:AddCustomAttributes,
cognito-idp:DescribeUserPool,
iam:PassRole

Delete

cognito-idp:DeleteUserPool

List

cognito-idp:ListUserPools