-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
131 lines (116 loc) · 3.68 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DevOps Automation with BBD Cloud Solutions</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
header {
background-color: #637c89;
color: white;
text-align: center;
padding: 1em 0;
}
.container {
max-width: 960px;
margin: 0 auto;
padding: 2em;
background-color: white;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.styled-table {
border-collapse: collapse;
margin: 25px 0;
font-size: 0.9em;
font-family: sans-serif;
min-width: 600px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}
.styled-table thead tr {
background-color: #848f8c;
color: #ffffff;
text-align: left;
}
.styled-table th {
padding: 12px 15px;
}
.styled-table tbody tr td {
padding: 12px 15px;
color: #4958c7;
/* Change this to your desired color */
}
.styled-table tbody tr {
border-bottom: 1px solid #dddddd;
}
.styled-table tbody tr:nth-of-type(even) {
background-color: #f3f3f3;
}
.styled-table tbody tr:last-of-type {
border-bottom: 2px solid #4958c7;
}
.styled-table tbody tr.active-row {
font-weight: bold;
color: #77a0e2;
}
footer {
background-color: #637c89;
color: white;
text-align: center;
padding: 1em 0;
position: absolute;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<?php
$TOKEN = shell_exec("curl -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds: 21600'");
$SERVER_HOSTNAME = gethostname();
$INSTANCE_TYPE = shell_exec("curl -H 'X-aws-ec2-metadata-token: $TOKEN' http://169.254.169.254/latest/meta-data/instance-type");
$PLACEMENT = shell_exec("curl -H 'X-aws-ec2-metadata-token: $TOKEN' http://169.254.169.254/latest/meta-data/placement/availability-zone");
?>
<header>
<h1>DevOps Automation with</h1>
<img src="https://bbdsoftware.com/wp-content/uploads/MServ-Black.png" width="500" height="120" />
</header>
<div class="container">
<h2>Welcome to DevOps Automation!</h2>
<p>This is a PHP web page deployed using Packer from a GitHub pipeline.
</p>
<table class="styled-table">
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr class="active-row">
<td>Server hostname:</td>
<td>
<?php echo $SERVER_HOSTNAME; ?>
</td>
</tr>
<tr>
<td>Instance Type:</td>
<td>
<?php echo $INSTANCE_TYPE; ?>
</td>
</tr>
<tr class="active-row">
<td>AZ:</td>
<td>
<?php echo $PLACEMENT; ?>
</td>
</tr>
</table>
</div>
<footer>
<p>© 2024 DevOps Automation with BBD Cloud Solutions</p>
</footer>
</body>
</html>