Amazon S3 provider for the CMS.IO namespace
I’m really happy to announce the brand new provider for the CMS.IO namespace. This feature enables you to store all files in your Kentico CMS web application to Amazon S3 (Simple Storage Service). This service is part of the Amazon web services cloud service. This blog post guides you through the installation and configuration of this provider.
We have included this provider into the latest hotfix package 6.0.18. After applying this hotfix, you still have to go through several steps to make it work. Installation of the provider depends on the type of project you are using.
Web site project
No special steps needs to be done.
Web application/Windows Azure project
-
Add reference to CMSApp project to CMS.AmazonStorage.dll.
-
Include ~/CMSPages/GetAmazonFile.aspx into CMSApp project.
Source code
-
Include the AmazonStorage project into your Kentico CMS solution.
-
Go through Visual studio migration wizard if you are using Visual studio 2010.
-
Set .NET version to 4 if you are using this version of .NET in the rest of the solution.
-
Add reference to CMSApp project to AmazonStorage project.
-
Include ~/CMSPages/GetAmazonFile.aspx into CMSApp project.
Configuration of the storage is the same for all types of projects and it’s all done via application settings keys in the
web.config file:
<add key="CMSStorageProviderAssembly" value="CMS.AmazonStorage" />
- Specifies that the Amazon S3 storage assembly is used.
<add key=”CMSExternalStorageName” value=”Amazon” />
- Specifies a provider name (this value is used in URL generation logic).
<add key=”CMSAmazonBucketName” value=”YourBucketName” />
- You need to specify the name of the bucket where you want to save the files. This bucket must already exist. A bucket name must be unique in the whole Amazon namespace so the provider doesn’t create it by itself.
<add key=” CMSAmazonAccessKeyID” value=”YourKey” />
- ID of an Amazon access key which is used for the authentication to the S3 storage.
<add key=”CMSAmazonAccessKey” value=”Your secret” />
- The Amazon access key which is used for the authentication to the S3 storage.
All the keys above are mandatory. There is also a set of optional keys:
<add key=”CMSAmazonTempPath” value=”PathToTemp” />
- Path to the directory where temporary files are stored. If you don’t specify this key, the temporary directory will be created in the OS temporary directory.
<add key=”CMSAmazonCachePath” value=”PathToCache” />
- Path to directory where cached files are stored. If you don’t specify this key temporary directory will be created in the OS temporary directory.
<add key=“CMSAmazonEndPoint“ value=“endpoint“ />
- Endpoint to the Amazon S3 storage. Here you can also specify the endpoint of the
CloudFront content delivery network. If you don’t specify this key, the endpoint will be in format
<yourbucketname>.s3.amazonaws.com.
<add key=“CMSAmazonPublicAccess“ value=“true/false“ />
- Specifies whether objects (files) in Amazon S3 uploaded through Kentico CMS are accessible for public users. The default value is true when an end point is specified. Otherwise, the default value is false.
I hope you will like this new provider. If you have any questions or remarks, let me know through the comments.