What is Amazon S3 ?
Amazon S3 is a “Simple Storage Service” Provided by amazon AWS. It allows you to store objects through a web service Interface.
First you will need to setup S3 bucket, Where you are going to store your files.
Create S3 Bucket
Go to Amazon Web Service Console and Login.
From services section Select S3.
Click on “Create Bucket” button and following screen will appear.
Now we need some encryption keys, secrets to communicate with S3 from Workice. For this AWS provides us IAM service where we can manage users and encryption keys.
Create IAM User
Let’s start with IAM service to generate Encryption key.
On AWS console page select IAM service.
On Left sidebar Select “Users” and on users page Click on “Add User”
Enter User name and set access type to “Programmatic access” as we are going to communicate programmatically with AWS services (S3). After that click on “Next Permissions”
On Next screen, Select “Attach Existing Policy Directly”. A list of Policies will appear. Search for S3 and select “AmazonS3FullAccess”. Then Click on “Next: Tags” Button.
You can skip tags as these are optional. Just click on “Next: Review Button”
On Review screen Verify all your settings and click on “Create User” Button.
After Creating user following screen will appear. Download .csv file which contains all your credentials (AWS Access Key Id & Secret Key).
Well Done, you are finished with all the configuration required on AWS side.
Setting Up Workice
In .env file put your AWS Credentials from the file you downloaded.
Also in .env file change FILESYSTEM_DRIVER=local to FILESYSTEM_DRIVER=s3
AWS_DEFAULT_REGION value is depend on the region you’ve selected while creating a new bucket.
E.g: If you selected Asia Pacific (Mumbai) then value of AWS_DEFAULT_REGION will be ap-south-1
Now your Workice files will be uploaded to Amazon S3.
You'll need to upload files from Workice /storage/ folder for the application to retrieve logos, avatars etc