Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit 25f5f9e

Browse files
committed
feat: add finished header and anthos verification script
1 parent 06ce72d commit 25f5f9e

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

pulumi/aws/anthos/verify.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python3
2+
3+
import requests
4+
import sys
5+
import json
6+
7+
stdin_json = json.load(sys.stdin)
8+
if 'application_url' not in stdin_json:
9+
raise ValueError("Missing expected key 'application_url' in STDIN json data")
10+
11+
url = f"{stdin_json['application_url']}/login"
12+
13+
payload = 'username=testuser&password=password'
14+
headers = {
15+
'Content-Type': 'application/x-www-form-urlencoded'
16+
}
17+
18+
response = requests.request("POST", url, headers=headers, data=payload, verify=False)
19+
response_code = response.status_code
20+
21+
if response_code != 200:
22+
print(f'Application failed health check [url={url},response_code={response_code}', file=sys.stderr)
23+
sys.exit(1)
24+
else:
25+
print('Application passed health check', file=sys.stderr)
26+
print(stdin_json['application_url'])

pulumi/aws/start_all.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,7 @@ pulumi $pulumi_args up
231231
header "Bank of Anthos"
232232
cd "${script_dir}/anthos"
233233
pulumi $pulumi_args up
234+
app_url="$(pulumi stack output --json | python3 "${script_dir}"/anthos/verify.py)"
235+
236+
header "Finished!"
237+
echo "Application can now be accessed at: ${app_url}"

0 commit comments

Comments
 (0)