question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

s3-deployment: allow disabling "sync --delete"

See original GitHub issue

The current behavior is aws sync --delete, which means that destination files that don’t exist in source will be deleted. In some scenarios (see #936) it might be useful to retain old files for the transition period when an app is updated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:19
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
IslamWahidcommented, Sep 3, 2021

@eladb with that prune option, how will the old files be deleted eventually? it’s necessary to keep them until the deployment is done but afterwards, we still want to remove them.

1reaction
martinnabhancommented, Apr 15, 2020

Still relevant for us too!

We’re trying to set different headers for only index.html, but currently it doesn’t seem to be possible. We’ve tried using two deployments, but since we can’t disable sync --delete it’s always one deployment or the other.

    new BucketDeployment(this, 'BucketDeployment', {
      sources: [Source.asset('../cms/dist', { exclude: ['.git', 'cdk.out', 'node_modules', 'index.html' })],
      destinationBucket: bucket,
      cacheControl: [CacheControl.fromString('max-age=31536000,public,immutable')],
    });

    new BucketDeployment(this, 'HTMLBucketDeployment', {
      sources: [Source.asset('../cms/dist', { exclude: ['**', '!index.html'] })],
      destinationBucket: bucket,
      cacheControl: [CacheControl.fromString('max-age=0,no-cache,no-store,must-revalidate')],
      contentType: 'text/html; charset=utf-8',
    });

Is there any other way of setting headers for specific objects?

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-cdk/aws-s3-deployment module - AWS Documentation
By default, files in the destination bucket that don't exist in the source will be deleted when the BucketDeployment resource is created or...
Read more >
Syncing data to Amazon S3 - Product documentation
If you want to enable or disable sync to S3 for a volume, select the volume and then click Sync to S3 or...
Read more >
Troubleshoot failed request to delete an Amazon S3 bucket
To delete an S3 bucket in either scenario, first suspend versioning (if enabled). Then, set up lifecycle rules to expire objects in the...
Read more >
AWS Sync Command: A Comprehensive Guide with 6 Examples
The above AWS sync command syncs objects of bucket to files in a local directory by uploading the local files to s3. Because...
Read more >
GitLab Container Registry administration
When you disable the Registry by following these steps, you do not remove any ... Sync any changes since the initial data load...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found