-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack.yaml
108 lines (101 loc) · 3.96 KB
/
stack.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
AWSTemplateFormatVersion: "2010-09-09"
Description: Deploys the full stack of the Service Mesh demo from https://github.com/edsenabr/servicemesh-demo
Resources:
ProviderStack:
Type: "AWS::CloudFormation::Stack"
Properties:
Parameters:
Role: provider
TemplateURL: "https://servicemesh-demo-templates.s3-sa-east-1.amazonaws.com/base.yaml"
ConsumerStack:
Type: "AWS::CloudFormation::Stack"
Properties:
Parameters:
Role: consumer
TemplateURL: "https://servicemesh-demo-templates.s3-sa-east-1.amazonaws.com/base.yaml"
NodeJSService:
Type: "AWS::CloudFormation::Stack"
DependsOn: ProviderStack
Properties:
Parameters:
AppName: nodejs
DesiredInstances: 2
Role: provider
VPCCIDR: !GetAtt ProviderStack.Outputs.VPCCIDR
VPCID: !GetAtt ProviderStack.Outputs.VPCID
NLBID: !GetAtt ProviderStack.Outputs.NLBID
ALBID: !GetAtt ProviderStack.Outputs.ALBID
SDID: !GetAtt ProviderStack.Outputs.SDID
PrivateSubnets: !GetAtt ProviderStack.Outputs.PrivateSubnets
TemplateURL: "https://servicemesh-demo-templates.s3-sa-east-1.amazonaws.com/service.yaml"
CrystalService:
Type: "AWS::CloudFormation::Stack"
DependsOn: ProviderStack
Properties:
Parameters:
AppName: crystal
DesiredInstances: 2
Role: provider
VPCCIDR: !GetAtt ProviderStack.Outputs.VPCCIDR
VPCID: !GetAtt ProviderStack.Outputs.VPCID
NLBID: !GetAtt ProviderStack.Outputs.NLBID
ALBID: !GetAtt ProviderStack.Outputs.ALBID
SDID: !GetAtt ProviderStack.Outputs.SDID
PrivateSubnets: !GetAtt ProviderStack.Outputs.PrivateSubnets
TemplateURL: "https://servicemesh-demo-templates.s3-sa-east-1.amazonaws.com/service.yaml"
FrontendUI:
Type: "AWS::CloudFormation::Stack"
DependsOn: ProviderStack
Properties:
Parameters:
AppName: frontend
DesiredInstances: 2
Role: provider
VPCCIDR: !GetAtt ProviderStack.Outputs.VPCCIDR
VPCID: !GetAtt ProviderStack.Outputs.VPCID
NLBID: !GetAtt ProviderStack.Outputs.NLBID
ALBID: !GetAtt ProviderStack.Outputs.ALBID
SDID: !GetAtt ProviderStack.Outputs.SDID
PrivateSubnets: !GetAtt ProviderStack.Outputs.PrivateSubnets
TemplateURL: "https://servicemesh-demo-templates.s3-sa-east-1.amazonaws.com/service.yaml"
APIGW:
Type: "AWS::CloudFormation::Stack"
DependsOn:
- ProviderStack
- ConsumerStack
- CrystalService
- NodeJSService
Properties:
Parameters:
NLBEndpoint: !GetAtt ProviderStack.Outputs.NLBEndpoint
NLBID: !GetAtt ProviderStack.Outputs.NLBID
VPCEndpoint: !GetAtt ConsumerStack.Outputs.VPCEndpoint
TemplateURL: "https://servicemesh-demo-templates.s3-sa-east-1.amazonaws.com/apigw.yaml"
NorthFrontendUI:
Type: "AWS::CloudFormation::Stack"
DependsOn: APIGW
Properties:
Parameters:
AppName: frontend
DesiredInstances: 2
Role: consumer
API: !GetAtt APIGW.Outputs.API
VPCCIDR: !GetAtt ConsumerStack.Outputs.VPCCIDR
VPCID: !GetAtt ConsumerStack.Outputs.VPCID
NLBID: !GetAtt ProviderStack.Outputs.NLBID
ALBID: !GetAtt ConsumerStack.Outputs.ALBID
SDID: !GetAtt ProviderStack.Outputs.SDID
PrivateSubnets: !GetAtt ConsumerStack.Outputs.PrivateSubnets
TemplateURL: "https://servicemesh-demo-templates.s3-sa-east-1.amazonaws.com/service.yaml"
Outputs:
RedScenarioURL:
Description: URL to access the Red Scenario frontend UI
Value: !GetAtt ConsumerStack.Outputs.ALBEndpoint
BlueScenarioURL:
Description: URL to access the Blue Scenario frontend UI
Value: !GetAtt ProviderStack.Outputs.ALBEndpoint
APIGWURL:
Description: URL to access the API Gateway Console
Value: !Sub
- https://console.aws.amazon.com/apigateway/home?region=${AWS::Region}#/apis/${API}/resources
- API: !GetAtt APIGW.Outputs.API