Serve aggregate CSS/JS files from S3 instead of local storage
It's all explained in the module's README.txt


  
  This will configure your site to store new uploaded files in S3.
  Files
  which your site creates automatically (such as aggregated CSS) will still
  be stored in the server's local filesystem, because Drupal is hard-coded
  to use the public:// filesystem for such files.
  However, s3fs can be configured to handle these files as well. In
  settings.php you can enable the s3fs.use_s3_for_public and
  s3fs.use_s3_for_private settings to make s3fs take over the job of the
  public and/or private file systems. This will cause your site to store
  newly uploaded/generated files from the public/private file system in S3
  instead of the local file system. However, it will make any existing files
  in those file systems become invisible to Drupal.
  To remedy this, you'll need to copy those files into your S3 bucket.
  
  Example:
  $settings['s3fs.use_s3_for_public'] = TRUE;
  If you use s3fs for public, you should change your php twig
  storage folder
  to a local directory, php twig files in S3 produce latency and security
  issues (these files would be public). Please change the php_storage settings in your setting.php and choose a directory, out of docroot
  recommended.
  
  Example:
  $settings['php_storage']['twig']['directory'] = '../storage/php';
  
  If you have a multiple backends you may use a NAS to store it or other
  shared storage system with your others backends.
  




Related Question: Serve compressed JS and CSS with S3 as filesystem