Go to file
2024-01-20 22:56:45 +00:00
ansible first commit 2024-01-20 22:51:23 +00:00
keys add keys directory do not get confused 2024-01-20 22:54:16 +00:00
.gitignore first commit 2024-01-20 22:51:23 +00:00
instances.tf first commit 2024-01-20 22:51:23 +00:00
main.tf first commit 2024-01-20 22:51:23 +00:00
networking.tf first commit 2024-01-20 22:51:23 +00:00
output.tf first commit 2024-01-20 22:51:23 +00:00
README.md first commit 2024-01-20 22:51:23 +00:00
variables.tf remove unused variable 2024-01-20 22:56:45 +00:00

Architecture Ref. Card 03

Für das Projekt kann ein eigenes Schlüsselpaar verwendet werden. Der Name des öffentlichen Schlüssels ist per default auf "ansible.pub" gesetzt - kann aber in der variables.tf angepasst werden. Der private Schlüssel könnte auch irgendwo anders liegen - in der variables.tf anpassen!

Terraform installiert eine RDS-Instanz (mariadb) und eine EC2-Instanz. Auf der EC2-Instanz wird zusätzlich ein mariadb-Server via Ansible installiert, da die Applikation die Datenbank-URL hart kodiert hat...

Ansible wird direkt durch Terraform gestartet. Man könnte das auch separat machen und die Ausgabe von "tofu output" oder "terraform output" direkt weiter verwursten.

  1. Erzeugen eines Schlüsselpaares
ssh-keygen -f keys/ansible -P ''
  1. tofu oder terraform init
  2. tofu oder terraform plan -out="name des jobs z.B. jokesdb"
  3. tofu oder terraform apply "name des jobs z.B. jokesdb"
  4. have fun

Was man noch so alles machen könnte:

  1. Portumleitung ingress 80 -> localhost 8080 oder besser
  2. Reverse-Proxy (z.B. nginx) und stattdessen ingress 80 -> ingress 443 und ingress 443 nach localhost 8080.
  3. Zertifikat mit LetsEncrypt drauf packen
  4. Applikation direkt auf dem Server kompilieren
  5. Applikation patchen, dass sie auch DDB_URI unterstützt...