-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathmaster.yaml
More file actions
99 lines (82 loc) · 2.91 KB
/
master.yaml
File metadata and controls
99 lines (82 loc) · 2.91 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
88
89
90
91
92
93
94
95
96
97
98
99
# Note : The Cloudformation Security Group IP address is open by default (testing purpose).
# You should update Security Group Access with your own IP Address to ensure your instances security.
#
# Prerequisites
# Before you can start this process, you need the following:
# - Your AWS account must have one VPC available to be created in the selected region
#
---
AWSTemplateFormatVersion: "2010-09-09"
Description: >
This is a master template to create a VPC infrastructure.
Last Modified: 15th April 2018
Author: Thinegan Ratnam <thinegan@thinegan.com>
###############################################################################################################
Parameters:
PMOWNIP:
Description: "Update this with your own office/home public ip address"
Type: "String"
PMTemplateURL:
Description: "S3 Cloudformation Template Bucket"
Type: "String"
PMVpcCIDR:
Description: "VPC CIDR."
Type: "String"
PMPublicSubnet1CIDR:
Description: "VPC Public Subnet 1."
Type: "String"
PMPublicSubnet2CIDR:
Description: "VPC Public Subnet 2."
Type: "String"
PMPrivateSubnet1CIDR:
Description: "VPC Private Subnet 1."
Type: "String"
PMPrivateSubnet2CIDR:
Description: "VPC Private Subnet 2."
Type: "String"
###############################################################################################################
Resources:
MyIAMRole:
Type: "AWS::CloudFormation::Stack"
Properties:
TemplateURL: !Sub "${PMTemplateURL}/vpc-iam.yaml"
TimeoutInMinutes: '5'
Parameters:
PMServerEnv: !Ref "AWS::StackName"
MyVPC:
Type: "AWS::CloudFormation::Stack"
DependsOn:
- "MyIAMRole"
Properties:
TemplateURL: !Sub "${PMTemplateURL}/vpc-vpc.yaml"
TimeoutInMinutes: '5'
Parameters:
PMServerEnv: !Ref "AWS::StackName"
PMVpcCIDR: !Ref "PMVpcCIDR"
PMPublicSubnet1CIDR: !Ref "PMPublicSubnet1CIDR"
PMPublicSubnet2CIDR: !Ref "PMPublicSubnet2CIDR"
PMPrivateSubnet1CIDR: !Ref "PMPrivateSubnet1CIDR"
PMPrivateSubnet2CIDR: !Ref "PMPrivateSubnet2CIDR"
PMFlowLogRole: !GetAtt "MyIAMRole.Outputs.VPCFlowLogRoleArn"
MyNACL:
Type: "AWS::CloudFormation::Stack"
DependsOn:
- "MyVPC"
Properties:
TemplateURL: !Sub "${PMTemplateURL}/vpc-nacl.yaml"
TimeoutInMinutes: '5'
Parameters:
PMServerEnv: !Ref "AWS::StackName"
PMOWNIP: !Ref "PMOWNIP"
PMVpcCIDR: !Ref "PMVpcCIDR"
PMVPC: !GetAtt "MyVPC.Outputs.VPC"
PMPrivateSubnet1CIDR: !Ref "PMPrivateSubnet1CIDR"
PMPrivateSubnet2CIDR: !Ref "PMPrivateSubnet2CIDR"
PMPublicNACL: !GetAtt "MyVPC.Outputs.MyPublicNetworkACL"
PMPrivateNACL: !GetAtt "MyVPC.Outputs.MyPrivateNetworkACL"
Outputs:
MyStackName:
Description: "A reference to Cloudformation Stack Name"
Value: !Ref "AWS::StackName"
Export:
Name: !Sub "${AWS::StackName}-StackName"