How to mount the S3 bucket on to the Mac
Description
S3 is very powerful architecture.
But it cannot use like normal directory.
However, we have the solution to mount S3 on Mac PC.
It's to use Storage Gateway.
Archtecture Image
| ー | ー | ー | 
Premise
Storage Gateway: Requirements for Amazon EC2 instance types https://docs.aws.amazon.com/storagegateway/latest/userguide/Requirements.html#requirements-hardware-ec2
[Recommended for file gateway types]
・General-purpose instance family – m4 or m5 instance type.
・Compute-optimized instance family – c4 or c5 instance types. Choose the 2xlarge instance size or higher to meet the required RAM requirements.
・Memory-optimized instance family – r3 instance types.
・Storage-optimized instance family – i3 instance types.
[Recommended for cached volumes and tape gateway types]
・General-purpose instance family – m4 or m5 instance types. We don't recommend using the m4.16xlarge instance type.
・Compute-optimized instance family – c4 or c5 instance types. Choose the 2xlarge instance size or higher to meet the required RAM requirements.
・Storage-optimized instance family – d2, i2, or i3 instance types.
Storage Gateway: Storage requirements https://docs.aws.amazon.com/storagegateway/latest/userguide/Requirements.html#requirements-storage
In addition to 80 GiB disk space for the VM, you also need additional disks for your gateway.
The following table recommends sizes for local disk storage for your deployed gateway.
Gateway Type	Cache (Minimum)	Cache (Maximum)	Upload Buffer (Minimum)	Upload Buffer (Maximum)	Other Required Local Disks
File gateway	150 GiB	64 TiB	—	—	—
| Gateway Type | Cache (Minimum) | Cache (Maximum) | Upload Buffer (Minimum) | Upload Buffer (Maximum) | Other Required Local Disks | 
|---|---|---|---|---|---|
| File gateway | 150 GiB | 64 TiB | - | - | - | 
You'll check any other requirements such as network in the public document.
Getting Started
- Setup the Storage Gateway- 
Open the Storage Gatewayconsole
- 
Click on the Get Started
- 
Click on the Nextafter selected theFile gateway
- 
Click on the Launch instanceand setting EC2 instance that it satisfied the requirementsNOTE: Storage Gatewayis using dedicated AMI. So, I recommend you to create EC2 instance from this link.
- 
Click on the Nextafter selected theAmazon EC2
- 
Click on the Nextafter selected thePublic
- 
Click on the Connect to gatewayafter input EC2 IP address
- 
Click on the Activate gatewayafter input gateway name
- 
Create EBS volume and attach to EC2 instance for Storage Gateway
- 
Click on the Configure logging
- 
Click on the Save and continue
 
- 
- Create the file sharing
- Create the S3 bucket for share with Storage Gateway
- Open the Storage Gatewayconsole
- Click on the Create file share
- Click on the Create file shareafter input S3 bucket name and select the NFS
- Click on the Next
- Click on the Create file share
 
- Create the S3 bucket for share with 
- Mount on the Mac
- Create the directory for mounting
- Mount to the directory by using the following commandmount_nfs -o vers=3,nolock,hard -v [Gateway public IP address]:/[S3 bucket name] [directory path]
 
Finally
This solution has following these costs.
- EC2
- EBS
- S3
- data communication and requests (including Storage Gateway)
So, you need to consider that you tolerate the cost of this solution or not.