AWS setup

May 13, 2020

Installation of survey solutions on amazon AWS

Installation has following steps:

  1. Create security group for web server and RDS to be able to communicate
  2. Create PostgreSQL instance
  3. Create ec2 instance for running Survey Solutions
  4. Install Survey Solutions

Create security group

In order to have connection between Survey Solutions and PostgreSQL you can create new security group as described in here.

In the create security group specify name and description:

Create Security Group

In the rules page add single required rule:

  • Type: PostgreSQL
  • Source: Start typying “Survey Solutions” and select just created security group Security Group Rules

Create PostgreSQL RDS instance

Create an RDS PostgreSQL instance using this documentation, you don’t need to install database client, but it can be used to test database connection.

During creation process expand Additional connectivity configuration section and assign created “Survey Solutions” security group Security Group Rules

Keep database port to be default one (5432)

After database is started copy endpoint address PostgreSQL endpoint

Create ec2 instance

  • In the services list Compute section select ec2
  • Find “Launch instance menu” Image selection
  • In search bar type “Windows”
  • Select Microsoft Windows Server 2019 Base Image selection
  • In tear selection pick one that suites your needs. You can check for server requirements here
  • After instance is created right click on it, select Networking -> Change Security Groups and assign group Survey Solutions Assign Security Group
  • Launch selected instance

Survey Solutions installation

When your instance is running, connect to it with rdp using instructions. Once connected, execute standalone installation steps (skip PostgreSQL part). When asked for database connection, input endpoint from RDS setup and database credentials.

Change port from 9700 to 80

Delete default web site from IIS web sites list and add :80 port binding to Survey Solutions web site:

  1. Right click on start menu -> run
  2. Execute inetmgr to start IIS manager
  3. On Right click on “Default Web Site” and select delete
  4. Select Survey Solutions site
  5. In the right panel add :80 port binding

Expose 80 port to external users

  • In the AWS console ec2 running instances find security group where only web server is included (for me it is “launch-wizard-1”): Open 80 port security group
  • Navigate to Network & Security -> Security Groups in the left panel
  • Find group of the web server and click on it
  • Click Edit Inbound Rules
  • Add Rule
    • Type: HTTP
  • Save rules

In Survey Solutions installation location Site folder find appsettings.production.ini file, and remove 9700 port from BaseUrl.

When done correctly you should be able to access Survey Solutions application from your browser by using public DNS: Public DNS EC2

Copy value from your console to browser address bar: Testing connection


Also we recommend enabling public DNS name for your survey solutions instance. Choose any DNS registrar you like, or maybe you already have domain name. When it is resolved to public IP address of amazon ec2 instance change BaseURL setting in appsettings.production.ini file. If SSL it used, set BaseUrl to https://%your dns name%.

S3 Configuration

Survey solutions can store multimedia data (images, audio audit, etc) on s3 storage to reduce load on database instance.

In order to enable s3 storage open s3 service console and create new bucket (you will need to pick name according to naming rules): Bucket creation

Now to enable Survey Solutions access to that bucket new IAM role will be required. In order to create it in services list find IAM, then go to Roles->Create new role: Role creation

Provide name, and attach appropriate policy: Role creation

In order to attach this role to ec2 instance open ec2 console, find appropriate image and select Attach/Replace IAM role: Attach role Then select created role: Attach role. Role selection

In Survey Solutions installation location Site folder find appsettings.production.ini file.

  1. Change storage options. In configuration file replace AppData key value to AppData=s3://%Your bucket name%/survey-solutions
  2. Add section with region configuration (use same region as your s3 bucket)

Your configuration file should contain such configuration:

AppData=s3://%Your bucket name%/survey-solutions
Region=us-east-1 # replace with your region

Restart windows image for changes to take effect.

Survey solutions will create folder with configured tenant name where it will store binary data for interviews.