Last active
March 12, 2018 20:17
-
-
Save jastang/78b313766d2c39e47e304eb0a3e31944 to your computer and use it in GitHub Desktop.
Moving an S3 object from point A to point B
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lambda_handler(event, context): | |
sb = event['Src_Bucket'] | |
sk = event['Src_Key'] | |
db = event['Dest_Bucket'] | |
dk = event['Dest_Key'] | |
src = { | |
'Bucket': sb, | |
'Key': sk | |
} | |
s3.copy(src, db, dk) | |
s3.delete_object(Bucket=sb, Key=sk) | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment