forked from knakayama/cfn-ci-cd-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfn.yml
86 lines (78 loc) · 1.92 KB
/
cfn.yml
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
---
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation CI/CD Demo
Parameters:
Stage:
Type: String
Default: dev
VPCCidrBlock:
Type: String
KeyName:
Type: AWS::EC2::KeyPair::KeyName
InstanceType:
Type: String
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: General Configuration
Parameters:
- Stage
- Label:
default: Network Configuration
Parameters:
- VPCCidrBlock
- Label:
default: Compute Configuration
Parameters:
- KeyName
- InstanceType
ParameterLabels:
Stage:
default: Stage
VPCCidrBlock:
default: VPC Cidr Block
KeyName:
default: Key Name
InstanceType:
default: Instance Type
Resources:
IAM:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: src/iam.yml
NW:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: src/network.yml
Parameters:
Stage: !Ref Stage
VPCCidrBlock: !Ref VPCCidrBlock
Custom:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: src/custom.yml
Parameters:
LambdaAMIInfoRoleArn: !GetAtt IAM.Outputs.LambdaAMIInfoRoleArn
SG:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: src/security_group.yml
Parameters:
Stage: !Ref Stage
VpcId: !GetAtt NW.Outputs.VpcId
Compute:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: src/compute.yml
Parameters:
Stage: !Ref Stage
SGId: !GetAtt SG.Outputs.SGId
SubnetId: !GetAtt NW.Outputs.SubnetId
InstanceProfile: !GetAtt IAM.Outputs.InstanceProfile
ImageId: !GetAtt Custom.Outputs.ImageId
KeyName: !Ref KeyName
InstanceType: !Ref InstanceType
Outputs:
PublicIp:
Value: !GetAtt Compute.Outputs.PublicIp