Skip to content

Commit

Permalink
app updated hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrico Goerlitz committed Jun 15, 2024
1 parent bca755c commit cf30eb0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
11 changes: 6 additions & 5 deletions app/app.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import os

from flask import Flask, jsonify
import socket


app = Flask(__name__)


@app.route("/")
def healthcheck():
internal_ip = socket.gethostbyname(socket.gethostname())
hostname = os.uname()[1]
return jsonify({
"healthcheck": "ok",
"internal_ip": internal_ip,
"hostname": hostname,
"version": "v2"
})


@app.route("/host")
def host_ip():
internal_ip = socket.gethostbyname(socket.gethostname())
return jsonify({"internal_ip": internal_ip})
hostname = os.uname()[1]
return jsonify({"hostname": hostname})


if __name__ == "__main__":
Expand Down
20 changes: 0 additions & 20 deletions docker/push-script.sh

This file was deleted.

File renamed without changes.
17 changes: 17 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# CREATE SECURITY GROUP
# - name=bp2-hosting-backend
# - allow only http traffic

# CREATE TARGET GROUP FOR LB
# - name=tg-bp2-hosting-backend

# CREATE APPLICATION LOAD BALANCER
# - name=lb-bp2-hosting-backend
# - internet facing, IPv4, AZ=1a+b+c

# CREATE LAUNCH TEMPLATE (EC2 Launch-Template)
# - name, AMI, t2.micro, no keypair, sg = sg-0f38bf63879bf9a9,
# default storage, AND User data = script!

# CREATE AUTOSCALING GROUP
# - name=asg-bp2-hosting-backend, vpc=default, AZ=eu-central-1a + 1b + 1c

0 comments on commit cf30eb0

Please sign in to comment.