Skip to content

Commit a97b5b1

Browse files
committed
Updated walkthrough and renamed ColorGateway to Frontend
1 parent b83385c commit a97b5b1

File tree

15 files changed

+31
-31
lines changed

15 files changed

+31
-31
lines changed

walkthroughs/howto-timeout-policy/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export ENVIRONMENT_NAME=AppMeshTimeoutExample
4848
export MESH_NAME=ColorApp-Timeout
4949
export ENVOY_IMAGE=<get the latest from https://docs.aws.amazon.com/app-mesh/latest/userguide/envoy.html>
5050
export SERVICES_DOMAIN="default.svc.cluster.local"
51-
export COLOR_GATEWAY_IMAGE_NAME="colorgateway"
51+
export FRONTEND_IMAGE_NAME="frontend"
5252
export COLOR_TELLER_IMAGE_NAME="colorteller"
5353
```
5454

@@ -73,13 +73,13 @@ Finally, build and deploy the color app images.
7373

7474
```bash
7575
./src/colorteller/deploy.sh
76-
./src/colorgateway/deploy.sh
76+
./src/frontend/deploy.sh
7777
```
7878
Note that the example apps use go modules. If you have trouble accessing https://proxy.golang.org during the deployment you can override the GOPROXY by setting `GO_PROXY=direct`
7979

8080
```bash
8181
GO_PROXY=direct ./src/colorteller/deploy.sh
82-
GO_PROXY=direct ./src/colorgateway/deploy.sh
82+
GO_PROXY=direct ./src/frontend/deploy.sh
8383
```
8484

8585
## Step 4: Create a Mesh
@@ -185,7 +185,7 @@ aws appmesh-preview update-route --mesh-name $MESH_NAME --cli-input-json file://
185185

186186
Confirm that we see request timeout as 20sec in the response
187187

188-
Then update the ColorGateway Virtual Node and ColortellerWhite Virtual Node to add timeout of 20secs at the listener. The spec at ColortellerWhite Virtual Node looks like below, similar timeout is set at ColorGateway Virtual Node too.
188+
Then update the Frontend Virtual Node and ColortellerWhite Virtual Node to add timeout of 20secs at the listener. The spec at ColortellerWhite Virtual Node looks like below, similar timeout is set at Frontend Virtual Node too.
189189

190190
```json
191191
{
@@ -222,7 +222,7 @@ Then update the ColorGateway Virtual Node and ColortellerWhite Virtual Node to a
222222
}
223223
```
224224
```bash
225-
./mesh/mesh.sh update_colorgateway-vn mesh/colorgateway-vn-timeout20s.json
225+
./mesh/mesh.sh update_frontend-vn mesh/frontend-vn-timeout20s.json
226226
./mesh/mesh.sh update_colorteller-white-vn mesh/colorteller-vn-timeout20s.json
227227
```
228228
Confirm that the response contains the timeout as 20secs and wait for few seconds for envoys to receive the latest config. Then curl the endpoint again with latency as 17, and this time we should get a successful response.
@@ -237,7 +237,7 @@ Virtual Gateway and Gateway Routes are new App Mesh resources that are in previe
237237

238238
Timeouts at Virtual Gateways are calculated implicitly based on the timeouts of the routes present in the Virtual Service that the Gateway Route points to. Currently there is no API to define the timeouts for gateways explicitly. In case you need any such feature, please request it using [App Mesh Github roadmap](https://github.com/aws/aws-app-mesh-roadmap/issues).
239239

240-
Lets create a Virtual Gateway(VG) and route the requests through it (basically replacing ColorGateway Virtual Node with public gateway VG) to verify that the timeout works well with VG too.
240+
Lets create a Virtual Gateway(VG) and route the requests through it (basically replacing Frontend Virtual Node with public gateway VG) to verify that the timeout works well with VG too.
241241

242242
```bash
243243
./mesh/mesh.sh add_virtual_gateway

walkthroughs/howto-timeout-policy/infrastructure/ecr-repositories.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \
1010
--capabilities CAPABILITY_IAM \
1111
--template-file "${DIR}/ecr-repositories.yaml" \
1212
--parameter-overrides \
13-
GatewayImageName="${COLOR_GATEWAY_IMAGE_NAME}" \
13+
FrontendImageName="${FRONTEND_IMAGE_NAME}" \
1414
ColorTellerImageName="${COLOR_TELLER_IMAGE_NAME}"

walkthroughs/howto-timeout-policy/infrastructure/ecr-repositories.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Parameters:
22

3-
GatewayImageName:
3+
FrontendImageName:
44
Description: The name for the gateway image
55
Type: String
66

@@ -10,10 +10,10 @@ Parameters:
1010

1111

1212
Resources:
13-
GatewayRepository:
13+
FrontendRepository:
1414
Type: AWS::ECR::Repository
1515
Properties:
16-
RepositoryName: !Ref GatewayImageName
16+
RepositoryName: !Ref FrontendImageName
1717

1818
ColorTellerRepository:
1919
Type: AWS::ECR::Repository

walkthroughs/howto-timeout-policy/infrastructure/ecs-service.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \
1414
ECSServicesDomain="${SERVICES_DOMAIN}" \
1515
AppMeshMeshName="${MESH_NAME}" \
1616
EnvoyImage="${ENVOY_IMAGE}" \
17-
ColorGatewayImageName="${COLOR_GATEWAY_IMAGE_NAME}" \
17+
FrontendImageName="${FRONTEND_IMAGE_NAME}" \
1818
ColorTellerImageName="${COLOR_TELLER_IMAGE_NAME}"

walkthroughs/howto-timeout-policy/infrastructure/ecs-service.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Parameters:
1616
Type: String
1717
Description: The image to use for the Envoy container
1818

19-
ColorGatewayImageName:
19+
FrontendImageName:
2020
Description: The name for the gateway image
2121
Type: String
2222

@@ -281,11 +281,11 @@ Resources:
281281
- 'Fn::ImportValue': !Sub "${EnvironmentName}:PrivateSubnet2"
282282
TaskDefinition: { Ref: ColorTellerRedTaskDefinition }
283283

284-
### colorgateway.default.svc.cluster.local
285-
ColorGatewayServiceDiscoveryRecord:
284+
### frontend.default.svc.cluster.local
285+
FrontendServiceDiscoveryRecord:
286286
Type: 'AWS::ServiceDiscovery::Service'
287287
Properties:
288-
Name: "colorgateway"
288+
Name: "frontend"
289289
DnsConfig:
290290
NamespaceId:
291291
'Fn::ImportValue': !Sub "${EnvironmentName}:ECSServiceDiscoveryNamespace"
@@ -295,7 +295,7 @@ Resources:
295295
HealthCheckCustomConfig:
296296
FailureThreshold: 1
297297

298-
ColorGatewayTaskDefinition:
298+
FrontendTaskDefinition:
299299
Type: AWS::ECS::TaskDefinition
300300
Properties:
301301
RequiresCompatibilities:
@@ -324,7 +324,7 @@ Resources:
324324
Value: '169.254.170.2,169.254.169.254'
325325
ContainerDefinitions:
326326
- Name: 'app'
327-
Image: !Sub '${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${ColorGatewayImageName}'
327+
Image: !Sub '${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${FrontendImageName}'
328328
Essential: true
329329
DependsOn:
330330
- ContainerName: 'envoy'
@@ -377,13 +377,13 @@ Resources:
377377
awslogs-stream-prefix: 'gateway-envoy'
378378
Environment:
379379
- Name: 'APPMESH_VIRTUAL_NODE_NAME'
380-
Value: !Sub 'mesh/${AppMeshMeshName}/virtualNode/ColorGateway'
380+
Value: !Sub 'mesh/${AppMeshMeshName}/virtualNode/Frontend'
381381
- Name: 'APPMESH_PREVIEW'
382382
Value: '1'
383383
- Name: 'ENVOY_LOG_LEVEL'
384384
Value: 'debug'
385385

386-
ColorGatewayService:
386+
FrontendService:
387387
Type: 'AWS::ECS::Service'
388388
DependsOn:
389389
- WebLoadBalancerRule
@@ -397,7 +397,7 @@ Resources:
397397
LaunchType: FARGATE
398398
ServiceRegistries:
399399
- RegistryArn:
400-
'Fn::GetAtt': ColorGatewayServiceDiscoveryRecord.Arn
400+
'Fn::GetAtt': FrontendServiceDiscoveryRecord.Arn
401401
NetworkConfiguration:
402402
AwsvpcConfiguration:
403403
AssignPublicIp: DISABLED
@@ -406,7 +406,7 @@ Resources:
406406
Subnets:
407407
- 'Fn::ImportValue': !Sub "${EnvironmentName}:PrivateSubnet1"
408408
- 'Fn::ImportValue': !Sub "${EnvironmentName}:PrivateSubnet2"
409-
TaskDefinition: { Ref: ColorGatewayTaskDefinition }
409+
TaskDefinition: { Ref: FrontendTaskDefinition }
410410
LoadBalancers:
411411
- ContainerName: app
412412
ContainerPort: 80

walkthroughs/howto-timeout-policy/mesh/mesh.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ main() {
242242
case "$action" in
243243
up)
244244
create_mesh "${TEST_MESH_DIR}/mesh.json"
245-
create_vnode "${TEST_MESH_DIR}/colorgateway-vn.json" "ColorGateway" "colorgateway"
245+
create_vnode "${TEST_MESH_DIR}/frontend-vn.json" "Frontend" "frontend"
246246
create_vnode "${TEST_MESH_DIR}/colorteller-vn.json" "ColorTellerWhite" "colorteller"
247247

248248
create_vrouter "${TEST_MESH_DIR}/colorteller-vr.json" "colorteller-vr"
@@ -254,7 +254,7 @@ main() {
254254
delete_vservice "colorteller.${SERVICES_DOMAIN}"
255255
delete_route "colorteller-vr" "colorteller-route"
256256
delete_vrouter "colorteller-vr"
257-
delete_vnode "ColorGateway"
257+
delete_vnode "Frontend"
258258
delete_vnode "ColorTellerWhite"
259259
delete_mesh
260260
;;
@@ -280,8 +280,8 @@ main() {
280280
update_colorteller-red-vn)
281281
update_vnode "$2" "ColorTellerRed" "colorteller-red"
282282
;;
283-
update_colorgateway-vn)
284-
update_vnode "$2" "ColorGateway" "colorgateway"
283+
update_frontend-vn)
284+
update_vnode "$2" "Frontend" "frontend"
285285
;;
286286
*)
287287
err "Invalid action specified: $action"

walkthroughs/howto-timeout-policy/mesh/mesh.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ Resources:
2626
Properties:
2727
MeshName: !Ref MeshName
2828

29-
ColorGatewayVirtualNode:
29+
FrontendVirtualNode:
3030
Type: AWS::AppMesh::VirtualNode
3131
Properties:
3232
MeshName: !GetAtt Mesh.MeshName
33-
VirtualNodeName: ColorGateway
33+
VirtualNodeName: Frontend
3434
Spec:
3535
BackendDefaults:
3636
ClientPolicy:
@@ -49,7 +49,7 @@ Resources:
4949
Protocol: http
5050
ServiceDiscovery:
5151
DNS:
52-
Hostname: !Sub "colorgateway.${ServicesDomain}"
52+
Hostname: !Sub "frontend.${ServicesDomain}"
5353

5454
ColorTellerVirtualNode:
5555
Type: AWS::AppMesh::VirtualNode

0 commit comments

Comments
 (0)