Connecting to S3 bucket and transferring files via Batch script

Advertisement

Venkit
Joined:
Posts:
2
Location:
USA

Connecting to S3 bucket and transferring files via Batch script

I am able to connect to the S3 bucket using the GUI. When I try to connect using a Windows batch script, I get "Access Denied" error message.

I have attached the Log file for your reference. The batch script is as follows:
:: This script takes care of sending the daily dispute file to Feedzai.
echo on
echo %date% %time%
SET  JOB=$RB0140F 
set cc=%date:~0,3%
set dd=%date:~7,2%
set mm=%date:~4,2%
set yy=%date:~10,4%
set hh=%time:~0,2%
set mi=%time:~3,2%
set ss=%time:~6,2%
 
"C:\Program Files (x86)\WinSCP\WinSCP.exe" ^
  /log="C:\EDUSER\PROJECTS\CASSMSTR\OUTBOUND\FEEDZAI\LOGS\WinSCP_%dd%.log" /ini=nul ^
  /command ^
    "open s3://AWS Access Key:AWS Secret Key@s3.amazonaws.com/feedzai-qa-chv-batch-processor-qa-us-east-1/input/ -rawsettings PingType=1" ^
    "lcd C:\EDUSER\PROJECTS\CASSMSTR" ^
    "cd /feedzai-qa-chv-batch-processor-qa-us-east-1/input" ^
    "put Hello.txt" ^
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%
Thanks,
Venkitachalam Subramanian
Description: Log file

Reply with quote E-mail

Advertisement

Venkit
Joined:
Posts:
2
Location:
USA

Connecting via batch mode to S3 bucket.

I used the batch file created by the Sessions generator and changed only the command portion. It is the put command that is causing the problem probably.

I understand that I will also not be able to upload files to the S3 bucket, because the external client needs files to be encrypted using SSE-KMS and they have a specific key id to go with the encryption.

So how can I encrypt the file and then upload to the S3 bucket. I do not see an option for encryption using SSE-KMS in the GUI.

Please help.

Reply with quote E-mail

martin
Site Admin
martin avatar

Re: Connecting via batch mode to S3 bucket.

I have no experience with SSE-KMS. But if it requires some special information in S3 API requests, then WinSCP does not support them.

Reply with quote

Advertisement

You can post new topics in this forum