samply / open-telekom-cloud

Terraform Provisioning for Resources on Open Telekom Cloud
1 stars 0 forks source link
lets-encrypt opentelekomcloud postgres terraform-provisioning

Terraform Provisioning for Resources on Open Telekom Cloud

Container Linux Images

Our VMs use Container Linux basis images. One can download them here. The images have to be imported into the OTC Image Management Service. The following steps have to be taken:

Managed Postgres Database

The Terraform Module Postgres describes a managed postgres database resource (RDS). The database is available under the hostname postgres.openstacklocal.

Root Access to the Database

ssh -L 5432:postgres:5432 otc-server-prod

Create a Database and User

CREATE DATABASE auth;
CREATE USER auth_user WITH ENCRYPTED PASSWORD '...';
GRANT auth_user TO root;
GRANT ALL PRIVILEGES ON DATABASE auth TO auth_user;

Create New Let's Encrypt Certificate

Check that the certificate isn't already known:

docker run --rm -v /etc/nginx/ssl:/etc/letsencrypt certbot/certbot:v0.36.0 certificates

First do a dry run for each domain:

docker run -it --rm \
  -v /etc/nginx/ssl:/etc/letsencrypt \
  -v acme-challenge:/certbot \
  certbot/certbot:v0.36.0 \
  certonly --dry-run --agree-tos --webroot --webroot-path /certbot \
  -d <domain>

If Nginx is down because of missing certificates, uncomment all server blocks listening to 443.

Than do the same removing --dry-run

Re-destroy