Reputation: 3
I have a lambda which is connecting to s3 and reading a file then it does some manuplation on the file and puts it back to a different bucket. my lambda has appropriate role to connect to s3 so its not a issue. I am able to read the file form s3 download into /tmp/ folder on lambda and do the changes. But when i try to put it back its using s3_client.put_object it gives following error
s3_client = boto3.client("s3")
# read the file
file_obj = s3.get_object(Bucket=bucket_name, Key=bucket_key)
file_content = file_obj["Body"].read()
# do some manuplation on it and try to upload it back to the s3
s3_client.put_object(Bucket=bucket_name, key=outbound_bucket_key, Body=output_path)
Parameter validation failed:
Missing required parameter in input: "Key"
Unknown parameter in input: "key", must be one of: ACL, Body, Bucket, CacheControl, ContentDisposition, ContentEncoding, ContentLanguage, ContentLength, ContentMD5, ContentType, Expires, GrantFullControl, GrantRead, GrantReadACP, GrantWriteACP, Key, Metadata, ServerSideEncryption, StorageClass, WebsiteRedirectLocation, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, SSEKMSKeyId, SSEKMSEncryptionContext, RequestPayer, Tagging, ObjectLockMode, ObjectLockRetainUntilDate, ObjectLockLegalHoldStatus
END RequestId: 88fd1324-7b14-4b24-b414-a0a04bb97bbd
REPORT RequestId: 88fd1324-7b14-4b24-b414-a0a04bb97bbd Duration: 4511.74 ms Billed Duration: 4600 ms Memory Size: 128 MB Max Memory Used: 128 MB Init Duration: 1179.77 ms
Upvotes: 0
Views: 1764
Reputation: 2355
Key
and not key
that what the error says.s3_client.put_object(Bucket=bucket_name, Key=outbound_bucket_key, Body=output_path)
Bucket
, Key
, Body
.Upvotes: 1