Quick debug: AWS S3 Invalid length for parameter Key

Nazreen Mohamad
1 min readJul 30, 2022

You’re here (hopefully) because you were trying to run the aws s3 cp command but got the error:

Parameter validation failed:
Invalid length for parameter Key, value: 0, valid range: 1-infLet’s cut to the chase.

Are you trying to upload a whole directory (e.g. the current directory)to your bucket ? A little bit like so:

aws s3 cp . s3://bucket-name

Then what you need to do is add the --recursive flag, like so:

aws s3 cp . s3://bucket-name…

--

--