Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to exclude files from being removed with DELETE_FLAG in an S3 pipeline?

Kind September 2, 2020

Hello,

I am working on an s3 pipeline for a project I am working on. I would like to utilize the DELETE_FLAG variable to empty the destination bucket before the pipeline deploys the latest built code, but I would like to exclude a particular set of files from being removed during this process. Typically I do this manually with the following S3 command: aws s3 rm --recursive --exclude "sitemap*" s3://BUCKET

I was looking at the EXTRA_ARGS variable but this appears to only apply to what is being uploaded to the bucket. Is there any way for me to prevent files with the name sitemap (wildcard) from being deleted when using the DELETE_FLAG variable in my S3 pipeline?

1 answer

0 votes
G_ Z_ September 10, 2020

Hello, @Kind !

Actually, in the pipe aws-s3-deploy pipe we are using sync aws cli command with this flag.

As I see AWS cli sync does not accept such an argument that you would like to use in EXTRA_ARGS since this is quite specific case.

https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

 

But you can still remove not needed files with your command in after-script section

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events