This repository was archived by the owner on Aug 19, 2021. It is now read-only.
File tree 3 files changed +45
-8
lines changed
3 files changed +45
-8
lines changed Original file line number Diff line number Diff line change @@ -85,12 +85,13 @@ Next step is to make sure that the frontend is able to talk to the NodeJS backen
85
85
``` bash
86
86
# Define variables
87
87
HOSTED_ZONE_ID=$( aws route53 list-hosted-zones-by-name \
88
- --dns-name appmeshworkshop.hosted.local \
89
- --max-items 1 | \
90
- jq -r ' .HostedZones | first | .Id' \
91
- | cut -d ' /' -f3) ;
92
- NODEJS_LB_URL=$( kubectl get service nodejs-app-service -n appmesh-workshop-ns -o json | jq -r ' .status.loadBalancer.ingress[].hostname' )
93
- NODEJS_LB_HOSTED_ZONE=$( aws elb describe-load-balancers | jq -r --arg lb " $NODEJS_LB_URL " ' .LoadBalancerDescriptions[]|select(.DNSName==$lb).CanonicalHostedZoneNameID' )
88
+ --dns-name appmeshworkshop.hosted.local \
89
+ --max-items 1 | \
90
+ jq -r ' .HostedZones | first | .Id' | cut -d ' /' -f3) ;
91
+ NODEJS_LB_URL=$( kubectl get service nodejs-app-service -n appmesh-workshop-ns -o json | \
92
+ jq -r ' .status.loadBalancer.ingress[].hostname' )
93
+ NODEJS_LB_HOSTED_ZONE=$( aws elb describe-load-balancers | \
94
+ jq -r --arg lb " $NODEJS_LB_URL " ' .LoadBalancerDescriptions[]|select(.DNSName==$lb).CanonicalHostedZoneNameID' )
94
95
# Create Route53 batch file
95
96
cat << -EOF > /tmp/add_nodejs_recordset.json
96
97
{
114
115
115
116
# Change route53 record set
116
117
aws route53 change-resource-record-sets \
117
- --hosted-zone-id $HOSTED_ZONE_ID \
118
- --change-batch file:///tmp/add_nodejs_recordset.json
118
+ --hosted-zone-id $HOSTED_ZONE_ID \
119
+ --change-batch file:///tmp/add_nodejs_recordset.json
119
120
```
120
121
121
122
Note that the DNS propagation might take a few minutes. Afther sometime you will be able to access your frontend application in the browser and see that you're now receiving responses back from the NodeJS app as well.
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ The output assumed-role name should contain:
55
55
56
56
```
57
57
AppMesh-Workshop-Admin
58
+ or
59
+ TeamRole
58
60
```
59
61
60
62
#### VALID
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ while getopts " :f:t:" opt; do
4
+ case $opt in
5
+ f) csv_file=" $OPTARG "
6
+ ;;
7
+ t) token=" $OPTARG "
8
+ ;;
9
+ \? ) echo " Invalid option -$OPTARG " >&2
10
+ ;;
11
+ esac
12
+ done
13
+
14
+ [ ! -f $INPUT ] && { echo " $INPUT file not found" ; exit 99; }
15
+ {
16
+ read
17
+ while IFS=, read -r game_id team_id name table_number team_hash team_hash_login aws_account_id status
18
+ do
19
+ unset AWS_SESSION_TOKEN
20
+ unset AWS_SECRET_ACCESS_KEY
21
+ unset AWS_ACCESS_KEY_ID
22
+
23
+ fed_login=$( curl -s -H ' Accept: application/json' -H " Authorization: Bearer ${token} " https://api.eventengine.run/games/${game_id} /teams/${team_id} /sign-in-url? type=team)
24
+ credentials=$( echo $fed_login | jq ' .credentials' )
25
+
26
+ export AWS_ACCESS_KEY_ID=` echo $credentials | jq -r ' ."access-key"' `
27
+ export AWS_SECRET_ACCESS_KEY=` echo $credentials | jq -r ' ."secret-key"' `
28
+ export AWS_SESSION_TOKEN=` echo $credentials | jq -r ' ."session-token"' `
29
+ export AWS_DEFAULT_REGION=us-west-2
30
+
31
+ status=$( aws cloudformation describe-stacks --stack-name appmesh-workshop | jq ' .Stacks | first | .StackStatus' )
32
+ echo ' Team ID:' ${team_id} ' ,Status:' $status
33
+ done
34
+ } < $csv_file
You can’t perform that action at this time.
0 commit comments