I am migrating code from boto2 to boto3 and want to the equivalent way to set the body of an object using boto3
I have tried using the .put(Body="123") but it replaces the s3 object and if i had some metadata previously, that metadata is removed (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Object.put )
Boto2:
bucket = s3_connection.get_bucket("bucket_name")
k = bucket.get_key("key")
k.set_contents_from_string("content")
This sets the content and still retains other properties like metadata
I'm looking for a way to do this using boto3