# getting-started


11/17/2021, 10:06 AM
Hi. I'm not sure if this is the correct channel, but here goes. I'm trying to use ObjectCopy to copy a file from one S3 bucket to another. I expect the source to update from time to time (newer versions of the file), but the destination (key) should stay the same. I simulate this behaviour by changing the source path - say:
original_src_path = /path/to/origObj
new_src_path = /path/to/newObj
When I execute pulumi up and select details, I see 3 actions are about to be done:
++awss3/objectCopyObjectCopy: (create-replacement)
+-awss3/objectCopyObjectCopy: (replace)
--awss3/objectCopyObjectCopy: (delete-replaced)
When I execute them, they happen in order, i.e. create, replace, delete. Thing is, the delete is deleting the newly created file (which has the same path), so I'm left with an empty bucket. To emphasize - create-replacement creates the object, but it's subsequently deleted. Question is, what am I doing wrong? Edit: apparently adding the following reverses the order of operation and works around the problem. seems like a bug to me though.
{deleteBeforeReplace: true}