Home > know-how > BeezDesk CRM > Configuration > Storing Attachments on Amazon S3

Storing Attachments on Amazon S3

The Amazon S3 File Archive integrations allows you to store attachments on the Amazon Cloud Storage. The integration can be configured in Configuration->System->Plugins.

The plugin helps to keep the database slim: X days after creating a ticket attachment the attachment will be moved from your database to your Amazon Storage. You still have access and can download the attachments as you are used to but it doesn't occupy space on your hosting/server.

Access Key and Secret Key - you get these while creating a user in your Amazon console under Services->IAM->Users.


Bucket Name - the name of your Amazon bucket into which you want to store your files. You get the name while creating the bucket from console in Services->S3->Create bucket.
When the bucket is created you also need to set its policy/privileges so that the created user whose access key you used have privileges to manage objects of this bucket. Here is an example policy string in which you need to replace the myuser and mybucket with your own IDs:

{
   "Version": "2012-10-17",
   "Id": "Policy1111111111111",
   "Statement": [
      {
         "Sid": "Stmt1111111111111",
         "Effect": "Allow",
         "Principal": {
            "AWS": "arn:aws:iam::111111111111:user/myuser"
         },
         "Action": [
            "s3:DeleteObject",
            "s3:GetObject",
            "s3:PutObject"
         ],
         "Resource": "arn:aws:s3:::mybucket/*"
      }
   ]
}


Client version - if you don't know what this is then just leave it as it is with latest


Region - You need to get the code of the region you selected for your bucket, to get the code you can search for your region in http://docs.aws.amazon.com/general/latest/gr/rande.html


Time to store files locally [hours] - time for how long should the files be kept on your hosting/server database before they are moved to Amazon. Should be some time after you expect not to access the files that often anymore.


Min file size [bytes] - only files larger than defined size will be moved to Amazon.
By default Amazon would bill you for every 128kB so even if you would set this limit to lower value than 131072B (128kB) and a smaller file would be moved to your Amazon storage you would still have to pay for it as if it was 128kB. However it might still be significantly cheaper than storing the data on your own hosting/server.

Note: if you should active this option after you have already tickets and attachments created in your database it won't really free up your hard drive space without running optimize task on your qu_g_file_contents database table.