HomeGuides
Submit Documentation FeedbackJoin Developer CommunityLog In

Deploying Commerce to Amazon Web Services (AWS)

This topic describes how to set up an Optimizely Commerce site to run on Amazon Web Services (AWS).

In this scenario, a Commerce core website is installed, and most steps can be applied through NuGet packages.

ūüďė

Note

This topic does not describe how to create/update a working Optimizely Commerce website, which is required for the Amazon deployment. See Installing Optimizely updates to do this.

Requirements

  • The AWS Management Console requires an account with login details.
  • A specific cloud-enabled license. See the Episerver License Center to add this license to the Commerce website.
  • All deployed applications and modules are designed for the cloud.
  • For the website to work properly with Amazon, create databases with collation SQL_Latin1_General_CP1_CI_AS. When you create a new Commerce site, first create the databases with the correct collation. Then, when you create the site using Deployment Center, use the Install site without database option and make sure to point to these databases instead of creating new ones.

Cloud website setup

Like an Optimizely CMS website on Amazon, you can run the Commerce website in an AWS Elastic Beanstalk environment with caching and multiple instances. The website instances share the same Amazon SQL instance, and the S3 storage in Amazon stores the file binary data. Load balancing is applied, and the Amazon SNS manages events between the Commerce websites.

Image - AWS Elastic Beanstalk environment

Using Auto Scaling, you can scale automatically through configuration.

Image - Auto Scaling screen

Follow these steps to create an Optimizely Commerce website running in an Amazon environment.

  1. Create Amazon resources.
    a. Log in to the AWS Management Console.
    b. Create an S3 storage bucket.

    When you run on Amazon, store the media (such as images) in the S3 storage to enable elastic scaling. See also [Creating a Bucket in the AWS documentation](http://docs.aws.amazon.com/AmazonS3/latest/UG/CreatingaBucket.html).
    
    i.  In the **AWS Management Console**, select **S3** from the **Services** menu.
    ii.  Select **Create Bucket** in the upper right corner and, in the dialog, select a region and provide a name.
    
    1. Create an SNS Topic.

      To scale for running on several instances, set up an SNS Topic to handle messages between site instances. See also Create a Topic in the AWS documentation.

      a. In the AWS Management Console, and select SNS from the Services menu.
      b. Click Create New Topic and, in the dialog, select a name.

    2. Create an RDS SQL instance.
      See also Creating a DB Instance Running the Microsoft SQL Server Database Engine.
      a. Open the AWS management console and select RDS in the Services menu.
      b. Click on Launch a DB Instance and, in the engine selection, select sqlserver-web (or another SQL server option).
      c. In the details view, provide the identifier name, size, login user and password.
      d. In the additional config, select the VPC security group previously created, and finish the wizard to create the DB instance.

    3. Create a Security Group.
      See also Amazon EC2 Security Groups in the AWS documentation.
      a. Open the AWS management console and select Services > EC2.
      b. Select Network & Security > Security Groups in the left menu.
      c. Click Create Security Group, provide a name and a description, and click Create.
      d. In the list, select the created group and select the Inbound tab in the lower panel.
      e. Select MS SQL from the rule dropdown, click Add Rule, then Apply Rule Changes.

  2. Upgrade and prepare the website.

    See Installing Episerver to install a Commerce website. When you have a project with a working website, continue with the following steps.

    a. Open the Optimizely Commerce front-end site project using Visual Studio.
    b. Upgrade the Commerce site to the latest version (minimum version 8.0).
    c. Install the EPiServer.Packaging.UI Nuget package.
    d. Run Move-EPiServerProtectedModules in the Package Manager Console.
    e. Install the EPiServer.Amazon NuGet package to the project.

ūüďė

Note

If you are installing Commerce Manager besides the Optimizely Commerce Core, continue with the following steps; otherwise, skip to C. Configure updates.

f.  Install the _EPiServer.Commerce.UI.ManagerIntegration_ NuGet package to the front-end site.
g.  Open the **Mediachase.ConsoleManagerUpdate** project, and upgrade it to the latest version (or 8.0 at least; see [Installing Optimizely updates](https://docs.developers.optimizely.com/content-cloud/v11.0.0-content-cloud/docs/installing-optimizely-updates-cms-11-and-commerce-13).
h.  Install the _EPiServer.Amazon_ NuGet package to the **Mediachase.ConsoleManagerUpdate** project.
  1. Configure updates.
    a. Map BLOB and Event providers.
    Open _EPiServerFramework.config_ and note the configuration under the **episerver.framework** section to map Blob/Event providers to Amazon.
    
    Code sample
    
<blob defaultProvider="s3blobs">
              <providers>
                <add name="s3blobs" 
                     type="EPiServer.Amazon.Blobs.AmazonBlobProvider,EPiServer.Amazon"
                     accessKey="{your_access_key}" 
                     secretKey="{your_secret_key}" 
                     region="{region_code}" 
                     bucket="mysitemedia"/>
              </providers>
            </blob>
            
            <event defaultProvider="amazonevents">
              <providers>
                <add name="amazonevents" 
                     type="EPiServer.Amazon.Events.AmazonEventProvider,EPiServer.Amazon"
                     accessKey="{your_access_key}" 
                     secretKey="{your_secret_key}" 
                     region="{region_code}" 
                     topic="mysiteevents"/>
              </providers>
            </event>

b. Configure search.

ūüďė

Note

When hosting in Amazon, use a scalable search solution such as Optimizely Search and Navigation (formerly Find). Because this is also a hosted service that you connect to, it works the same way as when your site runs on-premises. See the Configuring the Search & Navigation search provider to install and configure Optimizely Search & Navigation for Commerce.

    The Commerce website is ready for deployment to Amazon.
    
  1. Deploy the Commerce website.
    a Migrate the database to Amazon RDS SQL instance.

ūüďė

Note

In Optimizely Commerce, you need to migrate two databases, and you need to change the connectionStrings.config in the front-end and back-end sites.

    Open _connectionStrings.config_, change the connection string for EPiServerDB**,** EcfSqlConnection to the connection string from Amazone RDS SQL Database. Keep the setting MultipleActiveResultSets=true.
    Code sample
<connectionStrings>
              <add name="EPiServerDB" 
                   connectionString="Data Source={your_database_server_for_front_end};
                     Initial Catalog={database_name_for_front_end};
                     Integrated Security=False;
                     User ID={user_id};
                     Password={password};
                     MultipleActiveResultSets=True" 
                   providerName="System.Data.SqlClient" />
            
              <add name="EcfSqlConnection" 
                   connectionString="Data Source={your_database_server_for_back_end};
                     Initial Catalog={database_name_for_back_end};
                     Integrated Security=False;
                     User ID={user_id};
                     Password={password};
                     MultipleActiveResultSets=True" 
                   providerName="System.Data.SqlClient" />
            </connectionStrings>
b.  Deploy the website to Windows AWS Elastic Beanstalk.
    
    See also [For .NET Developers section in the AWS Elastic Beanstalk - Getting Started](http://aws.amazon.com/elasticbeanstalk/getting-started/#For_.NET_Developers).
    

ūüďė

Note

You need two websites: one for the Optimizely Commerce front-end site, and one for Commerce Manager.

c.  Transfer the website BLOBs to the S3 storage bucket.
    
    Typically, Optimizely BLOBs are stored in _C:\\EPiServer\\<MyEPiServerSite>\\appdata\\blobs_. See also [Add an Object to a Bucket](http://docs.aws.amazon.com/AmazonS3/latest/gsg/PuttingAnObjectInABucket.html).
    
  1. Activate the cloud license by going to the Admin view in CMS > Config tab > Manage Websites > Cloud License tab.
  2. Build the site index.
    a. Build the content index.
    b. Rebuild the catalog index. Go to Commerce Manager > Administration > System Settings > Search Index. Click Rebuild Index. The catalog index is restored on your Optimizely Search & Navigation indexes.

Did this page help you?