user_import_jobs
Creates, updates, deletes, gets or lists a user_import_jobs resource.
Overview
| Name | user_import_jobs |
| Type | Resource |
| Id | aws.cognito_idp.user_import_jobs |
Fields
The following fields are returned by SELECT queries:
- describe_user_import_job
- list_user_import_jobs
| Name | Datatype | Description |
|---|---|---|
cloud_watch_logs_role_arn | string | The role Amazon Resource Name (ARN) for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide. (pattern: <code>arn:[\w+=/,.@-]+:[\w+=/,.@-]+:([\w+=/,.@-]*)?:[0-9]+:[\w+=/,.@-]+(:[\w+=/,.@-]+)?(:[\w+=/,.@-]+)?</code>) |
completion_date | string (date-time) | The date when the user import job was completed. |
completion_message | string | The message returned when the user import job is completed. (pattern: <code>[\w]+</code>) |
creation_date | string (date-time) | The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object. |
failed_users | integer (int64) | The number of users that couldn't be imported. |
imported_users | integer (int64) | The number of users that were successfully imported. |
job_id | string | The ID of the user import job. (pattern: <code>import-[0-9a-zA-Z-]+</code>) |
job_name | string | The friendly name of the user import job. (pattern: <code>[\w\s+=,.@-]+</code>) |
password_hashing_algorithm | string | The password hashing algorithm used to generate the hashes in the CSV file for this import job. Valid values: BCRYPT | SCRYPT | ARGON2ID | PBKDF2_SHA256 (BCRYPT, SCRYPT, ARGON2ID, PBKDF2_SHA256) |
pre_signed_url | string | The pre-signed URL target for uploading the CSV file. |
skipped_users | integer (int64) | The number of users that were skipped. |
start_date | string (date-time) | The date when the user import job was started. |
status | string | The status of the user import job. One of the following: Created - The job was created but not started. Pending - A transition state. You have started the job, but it has not begun importing users yet. InProgress - The job has started, and users are being imported. Stopping - You have stopped the job, but the job has not stopped importing users yet. Stopped - You have stopped the job, and the job has stopped importing users. Succeeded - The job has completed successfully. Failed - The job has stopped due to an error. Expired - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job can't be started. (Created, Pending, InProgress, Stopping, Expired, Stopped, Failed, Succeeded) |
user_pool_id | string | The ID of the user pool that the users are being imported into. (pattern: <code>[\w-]+_[0-9a-zA-Z]+</code>) |
| Name | Datatype | Description |
|---|---|---|
pagination_token | string | The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. (pattern: <code>[\S]+</code>) |
user_import_jobs | array | An array of user import jobs from the requested user pool. For each, the response includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_user_import_job | select | region | Describes a user import job. For more information about user CSV import, see Importing users from a CSV file. | |
list_user_import_jobs | select | region | Given a user pool ID, returns user import jobs and their details. Import jobs are retained in user pool configuration so that you can stage, stop, start, review, and delete them. For more information about user import, see Importing users from a CSV file. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints | |
create_user_import_job | insert | region, JobName, UserPoolId, CloudWatchLogsRoleArn | Creates a user import job. You can import users into user pools from a comma-separated values (CSV) file without adding Amazon Cognito MAU costs to your Amazon Web Services bill. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_user_import_job
- list_user_import_jobs
Describes a user import job. For more information about user CSV import, see Importing users from a CSV file.
SELECT
cloud_watch_logs_role_arn,
completion_date,
completion_message,
creation_date,
failed_users,
imported_users,
job_id,
job_name,
password_hashing_algorithm,
pre_signed_url,
skipped_users,
start_date,
status,
user_pool_id
FROM aws.cognito_idp.user_import_jobs
WHERE region = '{{ region }}' -- required
;
Given a user pool ID, returns user import jobs and their details. Import jobs are retained in user pool configuration so that you can stage, stop, start, review, and delete them. For more information about user import, see Importing users from a CSV file. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints
SELECT
pagination_token,
user_import_jobs
FROM aws.cognito_idp.user_import_jobs
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_user_import_job
- Manifest
Creates a user import job. You can import users into user pools from a comma-separated values (CSV) file without adding Amazon Cognito MAU costs to your Amazon Web Services bill. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints
INSERT INTO aws.cognito_idp.user_import_jobs (
JobName,
UserPoolId,
CloudWatchLogsRoleArn,
PasswordHashingAlgorithm,
region
)
SELECT
'{{ JobName }}' /* required */,
'{{ UserPoolId }}' /* required */,
'{{ CloudWatchLogsRoleArn }}' /* required */,
'{{ PasswordHashingAlgorithm }}',
'{{ region }}'
RETURNING
user_import_job
;
# Description fields are for documentation purposes
- name: user_import_jobs
props:
- name: region
value: "{{ region }}"
description: Required parameter for the user_import_jobs resource.
- name: JobName
value: "{{ JobName }}"
description: |
A friendly name for the user import job.
- name: UserPoolId
value: "{{ UserPoolId }}"
description: |
The ID of the user pool that you want to import users into.
- name: CloudWatchLogsRoleArn
value: "{{ CloudWatchLogsRoleArn }}"
description: |
You must specify an IAM role that has permission to log import-job results to Amazon CloudWatch Logs. This parameter is the ARN of that role.
- name: PasswordHashingAlgorithm
value: "{{ PasswordHashingAlgorithm }}"
description: |
The password hashing algorithm used to generate the hashes in the CSV file for this import job. Valid values: BCRYPT | SCRYPT | ARGON2ID | PBKDF2_SHA256
valid_values: ['BCRYPT', 'SCRYPT', 'ARGON2ID', 'PBKDF2_SHA256']