Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

Commit 661b50a

Browse files
committed
updates for re:invent run
1 parent 8e0efad commit 661b50a

File tree

3 files changed

+45
-8
lines changed

3 files changed

+45
-8
lines changed

content/prerequisites/deploynode.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ Next step is to make sure that the frontend is able to talk to the NodeJS backen
8585
```bash
8686
# Define variables
8787
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')
9495
# Create Route53 batch file
9596
cat <<-EOF > /tmp/add_nodejs_recordset.json
9697
{
@@ -114,8 +115,8 @@ EOF
114115

115116
# Change route53 record set
116117
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
119120
```
120121

121122
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.

content/prerequisites/workspaceiam.md

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ The output assumed-role name should contain:
5555

5656
```
5757
AppMesh-Workshop-Admin
58+
or
59+
TeamRole
5860
```
5961

6062
#### VALID

scripts/check-deploy

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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

0 commit comments

Comments
 (0)