-
Notifications
You must be signed in to change notification settings - Fork 2
/
mesh.yaml
91 lines (85 loc) · 2.23 KB
/
mesh.yaml
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
Parameters:
ProjectName:
Type: String
Description: Project name to link stacks
Resources:
Mesh:
Type: AWS::AppMesh::Mesh
Properties:
MeshName: !Sub '${ProjectName}-mesh'
EchoClientNode:
Type: AWS::AppMesh::VirtualNode
Properties:
MeshName: !GetAtt Mesh.MeshName
VirtualNodeName: echo_client
Spec:
Backends:
- VirtualService:
VirtualServiceName: !Sub 'echo_server.${ProjectName}.local'
Listeners:
- PortMapping:
Port: 8080
Protocol: http
ServiceDiscovery:
AWSCloudMap:
NamespaceName: !Sub '${ProjectName}.local'
ServiceName: echo_client
EchoServerNode:
Type: AWS::AppMesh::VirtualNode
Properties:
MeshName: !GetAtt Mesh.MeshName
VirtualNodeName: echo_server
Spec:
Listeners:
- PortMapping:
Port: 8080
Protocol: grpc
HealthCheck:
HealthyThreshold: 2
IntervalMillis: 5000
TimeoutMillis: 2000
UnhealthyThreshold: 3
Port: 8080
Protocol: grpc
ServiceDiscovery:
AWSCloudMap:
NamespaceName: !Sub '${ProjectName}.local'
ServiceName: echo_server
VirtualRouter:
Type: AWS::AppMesh::VirtualRouter
Properties:
MeshName: !GetAtt Mesh.MeshName
VirtualRouterName: virtual-router
Spec:
Listeners:
- PortMapping:
Port: 8080
Protocol: grpc
VirtualService:
DependsOn:
- VirtualRouter
Type: AWS::AppMesh::VirtualService
Properties:
MeshName: !GetAtt Mesh.MeshName
VirtualServiceName: !Sub 'echo_server.${ProjectName}.local'
Spec:
Provider:
VirtualRouter:
VirtualRouterName: virtual-router
Route:
DependsOn:
- VirtualRouter
- EchoServerNode
Type: AWS::AppMesh::Route
Properties:
MeshName: !GetAtt Mesh.MeshName
VirtualRouterName: virtual-router
RouteName: route
Spec:
GrpcRoute:
Action:
WeightedTargets:
- VirtualNode: echo_server
Weight: 100
Match:
ServiceName: proto.echo.EchoService