-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yml
More file actions
87 lines (78 loc) · 2.38 KB
/
template.yml
File metadata and controls
87 lines (78 loc) · 2.38 KB
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Continuous Development Environment
Parameters:
BaseDomain:
Description: Base domain for the app
Type: String
CertificateArn:
Description: Certificate ARN
Type: String
Cloud9InstanceType:
Description: Cloud9 EC2 Instance Type
Type: String
Default: m5.large
RoleSSO:
Description: Federation Role Name
Type: String
User:
Description: Federated User email address
Type: String
Resources:
VpcStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: ./library/vpc.yml
Parameters:
Cidr: 10.0.0.0/16
Subnets: !Join
- ','
- - 10.0.1.0/24
- 10.0.2.0/24
LoadBalancerStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: ./library/load-balancer.yml
Parameters:
Vpc: !GetAtt VpcStack.Outputs.Vpc
Subnets: !GetAtt VpcStack.Outputs.Subnets
CertificateArn: !Ref CertificateArn
BaseDomain: !Ref BaseDomain
DevelopmentEnvironment:
Type: AWS::Cloud9::EnvironmentEC2
DependsOn: VpcStack
Properties:
AutomaticStopTimeMinutes: 30
InstanceType: !Ref Cloud9InstanceType
Name: !Ref AWS::StackName
SubnetId: !GetAtt VpcStack.Outputs.Subnet1
OwnerArn: !Sub 'arn:aws:sts::${AWS::AccountId}:assumed-role/${RoleSSO}/${User}'
Tags:
- Key: Cloud9
Value: 'yes'
- Key: Stack
Value: !Sub "${AWS::StackName}"
- Key: User
Value: !Ref User
Cloud9Elb1:
Type: AWS::CloudFormation::Stack
DependsOn: DevelopmentEnvironment
Properties:
TemplateURL: ./library/automation.yml
Parameters:
StackName: !Sub "${AWS::StackName}"
User: !Ref User
TargetSecurityGroup: !GetAtt LoadBalancerStack.Outputs.TargetSecurityGroup
appTargetGroup: !GetAtt LoadBalancerStack.Outputs.WebappTargetGroup
Port: 80
Cloud9Elb2:
Type: AWS::CloudFormation::Stack
DependsOn: DevelopmentEnvironment
Properties:
TemplateURL: ./library/automation.yml
Parameters:
StackName: !Sub "${AWS::StackName}"
User: !Ref User
TargetSecurityGroup: !GetAtt LoadBalancerStack.Outputs.TargetSecurityGroup
appTargetGroup: !GetAtt LoadBalancerStack.Outputs.ApiTargetGroup
Port: 3000