Skip to content

Tutorial

henrythasler edited this page Sep 21, 2019 · 4 revisions

Tutorial - work in progress

This tutorial will explain step-by-step, how to set-up the tileserver and all dependencies. Some day...

Prerequisites

To set up the whole environment you will need:

This tutorial assumes that you have all this set up and ready.

Initial Setup

AWS Credentials for terraform

  • In AWS Console: go to IAM, create a new user and create an access key for that user
  • On your local machine: run aws configure and enter the access keys incl. secret key as prompted.

Hosted Zone

To make the tileserver and website available you need to set up a hosted zone with AWS Route 53. See How to Make an AWS S3 Static Website With SSL for detailled instructions.

Certificate

Go to AWS Certificate Manager in us-east-1 and create a certificate for your domain. See How to Make an AWS S3 Static Website With SSL for detailled instructions.

optional: AWS Credentials for travis-ci

If you want to use travis-ci to deploy the code to lambda, you need to set up a user in IAM as described in Lambda Deployment

Terraform variables

You will need the following information in terraform/variables.tf to deploy the terraform config.

item description default
region The region you want to deploy to eu-central-1
postgres_host Hostname for the postgres-database. Not limited to aws. -
postgres_user username for the postgres-database postgres
postgres_password Password for postgres_user -
database_local Default database used for the tileserver local
domain Domain owned by you and set up in the hosted zone cyclemap.link You really want to change this...
tileserver_prefix Prefix used to set up tileserver-related stuff (e.g. subdomain). tileserver.
tilecache_prefix Prefix used to set up cache-related stuff (e.g. subdomain, S3-bucket). tiles.
vpc_id ID of the VPC you want to deploy to -
route_id ID of the route assigned to the VPC -
certificate_arn ARN of the certificate associated with the domain from AWS Certificate Manager -
log_level default log-level 3 (INFO)

You can add secret variables to terraform/secret.auto.tfvars:

postgres_password = "12345678"
postgres_host = "osmdata.0123456789abc.eu-central-1.rds.amazonaws.com"
vpc_id="vpc-00000000"
route_id="rtb-00000000"
certificate_arn="arn:aws:acm:us-east-1:0123456789012:certificate/0000000-0000-0000-0000-000000000000"

Make sure you DO NOT add terraform/secret.auto.tfvars to your repo.