aws-sdk-js icon indicating copy to clipboard operation
aws-sdk-js copied to clipboard

PreSignedUrl of createImportJob cant upload file .csv

Open khanwilson opened this issue 1 year ago • 2 comments

Describe the issue

i have downloaded template.csv and include some row data in. i want create job import users by aws sdk, by that step:

  • create CognitoIdentityServiceProvider
  • use provider.createUserImportJob(params) with params: JobName, UserPoolId, CloudWatchLogsRoleArn.
  • get PreSignedUrl from response createUserImportJob. call Put (by axios, postman) with header 'Content-Type': 'text/csv'. when time has valid but i always got 403 <Code>SignatureDoesNotMatch</Code> <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message> Untitled
  • got that error so i cant run startImportJob.

====== With params of createUserImportJob, i have do manually on Amazon Cognito>User pools>my pool>Create import job. It run oke. beside, i have check is my S3, i dont see any bucket name like "https://aws-cognito-idp-user-import-lhr.s3.eu-west-2.amazonaws.com" of first part in url PreSignedUrl. Why, createUserImportJob created link like that. Untitled2

Please explain this problem, and help me solve it :(

Links

https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentityServiceProvider.html#createUserImportJob-property

khanwilson avatar Aug 28 '24 08:08 khanwilson