Confirmed users
90
edits
(Moving info here) |
(add infra setup) |
||
| Line 1: | Line 1: | ||
== Infrastructure set-up == | |||
=== Create Cloudformation Stack === | |||
* Go to the AWS Console and click the Cloudformation service | |||
* Create a new stack using the full name of the discourse instance (csa-discourse-<app>-<env>) and [https://github.com/Mozilla-cIT/cloudformation/blob/master/discourse.template this] template. Click Next. | |||
* Enter the name and env of this discourse instance. The name should be below 4 characters, otherwise it may fail (Elasticache has a 20 character limit). Click Next. | |||
* Do not add any tags, these are done automatically. Click create stack. | |||
* Wait a bit. The Elasticache server takes a while to set up. | |||
* If Cloudformation shows the status as CREATE_COMPLETE, most of the infrastructure has been set up. | |||
* Go to the Outputs tab to see the Load balancer's DNS name and the Postgres DB instance you should be using. | |||
=== Add DNS record for the Elasticache node === | |||
* Go the Elasticache service in the AWS Console. | |||
* Find the Elasticache node that Cloudformation spun up and click on '1 Node'. Copy the endpoint for this node. | |||
* Go to the Route 53 and go to the correct hosting zone. For production instances, use mofoprod.net and for staging instances, use mofostaging.net. Create a new CNAME record pointing to the Elasticache endpoint, and the TTL as 60. | |||
* The domain that users will access Discourse from should be an A alias record pointing to the Load Balancer that Cloudformation created. | |||
=== Create Database === | |||
psql -h pgshared-db.mofostaging.net --user=root template1 | |||
CREATE USER csa<app> WITH PASSWORD 'aStrongPasswordHere'; | |||
CREATE DATABASE csa<app>db; | |||
GRANT ALL PRIVILEGES ON DATABASE csa<app>db to csa<app>; | |||
CREATE EXTENSION IF NOT EXISTS hstore; | |||
CREATE EXTENSION IF NOT EXISTS pg_trgm; | |||
== Discourse set-up == | == Discourse set-up == | ||
=== Install Discourse === | === Install Discourse === | ||