-
Notifications
You must be signed in to change notification settings - Fork 8
Tutorial
This tutorial will explain step-by-step, how to set-up the tileserver and all dependencies. Some day...
To set up the whole environment you will need:
- Account with Amazon Web Services (AWS) - Cloud Computing Services. Make sure you set up Multi-Factor Authentication to ensure account security!
- Node.js® JavaScript runtime installed on your local machine.
- AWS Command Line Interface installed on your local machine.
- Terraform installed on your local machine.
- A database with imported and preprocessed openstreetmap-data that is accessible from your AWS account. It could be a RDS-Instance in AWS or something totally different with another provider.
This tutorial assumes that you have all this set up and ready.
- 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.
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.
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.
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
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.