forked from chrisolido/aws-alb-sandwich
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LbSandwichNlbInternal.yml
1255 lines (1254 loc) · 31.6 KB
/
LbSandwichNlbInternal.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
AWSTemplateFormatVersion: 2010-09-09
Description: >-
Creates an Load Balancer Sandwich, External LB and Internal NLB, with two
firewalls and two web servers
Parameters:
WebInstanceType:
Description: WebServer EC2 instance type
Type: String
Default: t2.micro
AllowedValues:
- t2.nano
- t2.micro
- t2.small
- t2.medium
- t2.large
- t2.xlarge
- t2.2xlarge
- t3.nano
- t3.micro
- t3.small
- t3.medium
- t3.large
- t3.xlarge
- t3.2xlarge
- t3a.nano
- t3a.micro
- t3a.small
- t3a.medium
- t3a.large
- t3a.xlarge
- t3a.2xlarge
- m3.medium
- m3.large
- m3.xlarge
- m3.2xlarge
- m4.large
- m4.xlarge
- m4.2xlarge
- m4.4xlarge
- m4.10xlarge
- m4.16xlarge
- m5.large
- m5.xlarge
- m5.2xlarge
- m5.4xlarge
- m5.8xlarge
- m5.12xlarge
- m5.16xlarge
- m5.24xlarge
- m5.metal
- m5a.large
- m5a.xlarge
- m5a.2xlarge
- m5a.4xlarge
- m5a.8xlarge
- m5a.12xlarge
- m5a.16xlarge
- m5a.24xlarge
- m5ad.large
- m5ad.xlarge
- m5ad.2xlarge
- m5ad.4xlarge
- m5ad.12xlarge
- m5ad.24xlarge
- m5d.large
- m5d.xlarge
- m5d.2xlarge
- m5d.4xlarge
- m5d.8xlarge
- m5d.12xlarge
- m5d.16xlarge
- m5d.24xlarge
- m5d.metal
- c3.large
- c3.xlarge
- c3.2xlarge
- c3.4xlarge
- c3.8xlarge
- c4.large
- c4.xlarge
- c4.2xlarge
- c4.4xlarge
- c4.8xlarge
- c5.large
- c5.xlarge
- c5.2xlarge
- c5.4xlarge
- c5.9xlarge
- c5.12xlarge
- c5.18xlarge
- c5.24xlarge
- c5.metal
- c5d.large
- c5d.xlarge
- c5d.2xlarge
- c5d.4xlarge
- c5d.9xlarge
- c5d.18xlarge
- c5n.large
- c5n.xlarge
- c5n.2xlarge
- c5n.4xlarge
- c5n.9xlarge
- c5n.18xlarge
- cc2.8xlarge
- cr1.8xlarge
- x1.16xlarge
- x1.32xlarge
- x1e.xlarge
- x1e.2xlarge
- x1e.4xlarge
- x1e.8xlarge
- x1e.16xlarge
- x1e.32xlarge
- r3.large
- r3.xlarge
- r3.2xlarge
- r3.4xlarge
- r3.8xlarge
- r4.large
- r4.xlarge
- r4.2xlarge
- r4.4xlarge
- r4.8xlarge
- r4.16xlarge
- r5.large
- r5.xlarge
- r5.2xlarge
- r5.4xlarge
- r5.8xlarge
- r5.12xlarge
- r5.16xlarge
- r5.24xlarge
- r5.metal
- r5a.large
- r5a.xlarge
- r5a.2xlarge
- r5a.4xlarge
- r5a.8xlarge
- r5a.12xlarge
- r5a.16xlarge
- r5a.24xlarge
- r5ad.large
- r5ad.xlarge
- r5ad.2xlarge
- r5ad.4xlarge
- r5ad.12xlarge
- r5ad.24xlarge
- r5d.large
- r5d.xlarge
- r5d.2xlarge
- r5d.4xlarge
- r5d.8xlarge
- r5d.12xlarge
- r5d.16xlarge
- r5d.24xlarge
- r5d.metal
- p2.xlarge
- p2.8xlarge
- p2.16xlarge
- p3.2xlarge
- p3.8xlarge
- p3.16xlarge
- p3dn.24xlarge
- g2.2xlarge
- g2.8xlarge
- g3.4xlarge
- g3.8xlarge
- g3.16xlarge
- g3s.xlarge
- f1.2xlarge
- f1.4xlarge
- f1.16xlarge
- h1.2xlarge
- h1.4xlarge
- h1.8xlarge
- h1.16xlarge
- hs1.8xlarge
- i2.xlarge
- i2.2xlarge
- i2.4xlarge
- i2.8xlarge
- i3.large
- i3.xlarge
- i3.2xlarge
- i3.4xlarge
- i3.8xlarge
- i3.16xlarge
- i3.metal
- i3en.large
- i3en.xlarge
- i3en.2xlarge
- i3en.3xlarge
- i3en.6xlarge
- i3en.12xlarge
- i3en.24xlarge
- d2.xlarge
- d2.2xlarge
- d2.4xlarge
- d2.8xlarge
- z1d.large
- z1d.xlarge
- z1d.2xlarge
- z1d.3xlarge
- z1d.6xlarge
- z1d.12xlarge
- z1d.metal
ConstraintDescription: must be a valid EC2 instance type.
KeyName:
Description: Amazon EC2 Key Pair
Type: 'AWS::EC2::KeyPair::KeyName'
VPCCIDR:
Type: String
Default: 192.168.0.0/16
Description: Enter the VPC CIDR that you want to use
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
ConstraintDescription: must be a valid CIDR range of the form x.x.x.x/x.
VpcAzs:
Type: 'List<AWS::EC2::AvailabilityZone::Name>'
Description: Select 2 AZs
MgmtSubnetIpBlocks:
Description: Management subnet comma-delimited list of CIDR blocks
Type: CommaDelimitedList
Default: '192.168.0.0/24, 192.168.10.0/24'
UntrustSubnetIpBlocks:
Description: Untrust subnet comma-delimited list of CIDR blocks
Type: CommaDelimitedList
Default: '192.168.1.0/24, 192.168.11.0/24'
TrustSubnetIpBlocks:
Description: Trust subnet comma-delimited list of CIDR blocks
Type: CommaDelimitedList
Default: '192.168.2.0/24, 192.168.3.0/24'
NATGWSubnetIpBlocks:
Description: AWS NAT Gateway Comma-delimited list of CIDR blocks
Type: CommaDelimitedList
Default: '192.168.100.0/24, 192.168.101.0/24'
SGforAdmin:
Description: IP info for fw mgmt lockdown
Type: String
Default: 1.2.3.4/32
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
ConstraintDescription: must be a valid CIDR range of the form x.x.x.x/x.
FirewallAMI:
Description: >-
Input the firewall AMI ID.
https://docs.paloaltonetworks.com/compatibility-matrix/vm-series-firewalls/aws-cft-amazon-machine-images-ami-list
Type: 'AWS::EC2::Image::Id'
FWInstanceType:
Type: String
Default: c5.xlarge
AllowedValues:
- c5.xlarge
- c5.2xlarge
- c5.4xlarge
- c5.9xlarge
- c5.18xlarge
- c5n.xlarge
- c5n.2xlarge
- c5n.4xlarge
- c5n.9xlarge
- c5n.18xlarge
- m5.xlarge
- m5.2xlarge
- m5.4xlarge
- m5.12xlarge
- m5.24xlarge
- m5n.xlarge
- m5n.2xlarge
- m5n.4xlarge
- m5n.8xlarge
- c4.xlarge
- c4.2xlarge
- c4.4xlarge
- c4.8xlarge
- m4.xlarge
- m4.2xlarge
- m4.4xlarge
- c3.xlarge
- c3.2xlarge
- c3.4xlarge
- c3.8xlarge
- m3.xlarge
- m3.2xlarge
Description: Enter the instance type and size for the VM-Series firewall
S3BucketName:
Type: String
Description: Enter the name S3 Bucket Name containing the Bootstrap files
MinLength: '3'
MaxLength: '120'
Mappings:
AWSRegionAMIEC2:
ap-east-1:
Xenial: ami-5cdb9c2d
ap-northeast-1:
Xenial: ami-003c6ed5c5176db19
ap-south-1:
Xenial: ami-011c09ac5e09ba22f
ap-southeast-1:
Xenial: ami-0b21b3ea2cb8660a5
ca-central-1:
Xenial: ami-02da4c4d67205fcc8
eu-central-1:
Xenial: ami-0257508f40836e6cf
eu-north-1:
Xenial: ami-0eb04b36ce3c3b0ac
eu-west-1:
Xenial: ami-01793b684af7a3e2c
me-south-1:
Xenial: ami-00df020967accef43
sa-east-1:
Xenial: ami-017555a9eb5076e5f
us-east-1:
Xenial: ami-04ac550b78324f651
us-west-1:
Xenial: ami-0798ac7e2b0fb9e75
us-gov-west-1:
Xenial: ami-50624831
us-gov-east-1:
Xenial: ami-b57b96c4
ap-northeast-2:
Xenial: ami-0582405a4f3bf27c9
ap-southeast-2:
Xenial: ami-09d19bae4dbb07062
eu-west-2:
Xenial: ami-014ae7e330e2651dc
us-east-2:
Xenial: ami-0009e532719fe9bff
us-west-2:
Xenial: ami-02e30ba14d8ffa6e6
ap-northeast-3:
Xenial: ami-077284ebb02f61464
eu-west-3:
Xenial: ami-0a3fd389b49c645bf
Metadata:
'AWS::CloudFormation::Interface':
ParameterLabels:
VPCCIDR:
default: CIDR Block for the VPC
MgmtSubnetIpBlocks:
default: Management Subnet CIDR Block
UntrustSubnetIpBlocks:
default: Untrust Subnet CIDR Block
TrustSubnetIpBlocks:
default: Trust Subnet CIDR Block
NATGWSubnetIpBlocks:
default: NAT Gateway Subnet CIDR Block
WebInstanceType:
default: Web Server Instance Size
KeyName:
default: 'Key pair:'
FWInstanceType:
default: Firewall Instance Size
S3BucketName:
default: Firewall Bootstrap Bucket
VpcAzs:
default: Availability Zones
ParameterGroups:
- Label:
default: VPC Configuration
Parameters:
- VpcAzs
- VPCCIDR
- MgmtSubnetIpBlocks
- UntrustSubnetIpBlocks
- TrustSubnetIpBlocks
- NATGWSubnetIpBlocks
- KeyName
- Label:
default: Firewall Configuration
Parameters:
- FWInstanceType
- FirewallAMI
- S3BucketName
- Label:
default: Web Server Configuration
Parameters:
- WebInstanceType
Resources:
VPC:
Type: 'AWS::EC2::VPC'
Properties:
CidrBlock: !Ref VPCCIDR
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: MGMT
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- VPC
PublicSubnetAz1:
Type: 'AWS::EC2::Subnet'
Properties:
AvailabilityZone: !Select
- '0'
- !Ref VpcAzs
MapPublicIpOnLaunch: true
VpcId: !Ref VPC
CidrBlock: !Select
- '0'
- !Ref NATGWSubnetIpBlocks
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: NATGW
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- PublicSubnetAz1
PublicSubnetAz2:
Type: 'AWS::EC2::Subnet'
Properties:
AvailabilityZone: !Select
- '1'
- !Ref VpcAzs
MapPublicIpOnLaunch: true
VpcId: !Ref VPC
CidrBlock: !Select
- '1'
- !Ref NATGWSubnetIpBlocks
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: NATGW
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- PublicSubnetAz2
MGMTSubnetAz1:
Type: 'AWS::EC2::Subnet'
Properties:
AvailabilityZone: !Select
- '0'
- !Ref VpcAzs
MapPublicIpOnLaunch: true
VpcId: !Ref VPC
CidrBlock: !Select
- '0'
- !Ref MgmtSubnetIpBlocks
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: MGMT
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- MGMTSubnetAz1
MGMTSubnetAz2:
Type: 'AWS::EC2::Subnet'
Properties:
AvailabilityZone: !Select
- '1'
- !Ref VpcAzs
MapPublicIpOnLaunch: true
VpcId: !Ref VPC
CidrBlock: !Select
- '1'
- !Ref MgmtSubnetIpBlocks
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: MGMT
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- MGMTSubnetAz2
UNTRUSTSubnet1:
Type: 'AWS::EC2::Subnet'
Properties:
AvailabilityZone: !Select
- '0'
- !Ref VpcAzs
VpcId: !Ref VPC
CidrBlock: !Select
- '0'
- !Ref UntrustSubnetIpBlocks
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: UNTRUST
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- UNTRUSTSubnet1
UNTRUSTSubnet2:
Type: 'AWS::EC2::Subnet'
Properties:
AvailabilityZone: !Select
- '1'
- !Ref VpcAzs
VpcId: !Ref VPC
CidrBlock: !Select
- '1'
- !Ref UntrustSubnetIpBlocks
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: UNTRUST
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- UNTRUSTSubnet2
TRUSTSubnet1:
Type: 'AWS::EC2::Subnet'
Properties:
AvailabilityZone: !Select
- '0'
- !Ref VpcAzs
VpcId: !Ref VPC
CidrBlock: !Select
- '0'
- !Ref TrustSubnetIpBlocks
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: TRUST
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- TRUSTSubnet1
TRUSTSubnet2:
Type: 'AWS::EC2::Subnet'
Properties:
AvailabilityZone: !Select
- '1'
- !Ref VpcAzs
VpcId: !Ref VPC
CidrBlock: !Select
- '1'
- !Ref TrustSubnetIpBlocks
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: TRUST
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- TRUSTSubnet2
sgWideOpen:
Type: 'AWS::EC2::SecurityGroup'
Properties:
GroupDescription: Wide open security group
SecurityGroupIngress:
- IpProtocol: '-1'
CidrIp: 0.0.0.0/0
SecurityGroupEgress:
- IpProtocol: '-1'
CidrIp: 0.0.0.0/0
VpcId: !Ref VPC
SGforlockdown:
Type: 'AWS::EC2::SecurityGroup'
Properties:
GroupDescription: admin lockdown sg
SecurityGroupIngress:
- IpProtocol: '-1'
CidrIp: !Ref SGforAdmin
SecurityGroupEgress:
- IpProtocol: '-1'
CidrIp: 0.0.0.0/0
VpcId: !Ref VPC
InternetGateway:
Type: 'AWS::EC2::InternetGateway'
Properties:
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: MGMT
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- InternetGateway
GatewayToInternet:
Type: 'AWS::EC2::VPCGatewayAttachment'
Properties:
VpcId: !Ref VPC
InternetGatewayId: !Ref InternetGateway
NATGWRouteTableAz1:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- NATGWRouteTableAz1
NATGWRouteTableAz2:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- NATGWRouteTableAz2
NATGWRoute1:
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref NATGWRouteTableAz1
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref InternetGateway
DependsOn:
- GatewayToInternet
NATGWRoute2:
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref NATGWRouteTableAz2
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref InternetGateway
DependsOn:
- GatewayToInternet
NAT1SubnetRouteTableAssociation:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
SubnetId: !Ref PublicSubnetAz1
RouteTableId: !Ref NATGWRouteTableAz1
NAT2SubnetRouteTableAssociation:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
SubnetId: !Ref PublicSubnetAz2
RouteTableId: !Ref NATGWRouteTableAz2
EIP1:
Type: 'AWS::EC2::EIP'
Properties:
Domain: vpc
DependsOn:
- VPC
- GatewayToInternet
- InternetGateway
EIP2:
Type: 'AWS::EC2::EIP'
Properties:
Domain: vpc
DependsOn:
- VPC
- GatewayToInternet
- InternetGateway
EIPfw1:
Type: 'AWS::EC2::EIP'
Properties:
Domain: vpc
DependsOn:
- VPC
- GatewayToInternet
- InternetGateway
EIPfw2:
Type: 'AWS::EC2::EIP'
Properties:
Domain: vpc
DependsOn:
- VPC
- GatewayToInternet
- InternetGateway
fw1MgmtEIPAssoc:
Type: 'AWS::EC2::EIPAssociation'
Properties:
AllocationId: !GetAtt
- EIPfw1
- AllocationId
NetworkInterfaceId: !Ref FW1ManagementNetworkInterface
fw2MgmtEIPAssoc:
Type: 'AWS::EC2::EIPAssociation'
Properties:
AllocationId: !GetAtt
- EIPfw2
- AllocationId
NetworkInterfaceId: !Ref FW2ManagementNetworkInterface
NAT1:
Type: 'AWS::EC2::NatGateway'
Properties:
AllocationId: !GetAtt
- EIP1
- AllocationId
SubnetId: !Ref PublicSubnetAz1
DependsOn:
- VPC
- GatewayToInternet
NAT2:
Type: 'AWS::EC2::NatGateway'
Properties:
AllocationId: !GetAtt
- EIP2
- AllocationId
SubnetId: !Ref PublicSubnetAz2
DependsOn:
- VPC
- GatewayToInternet
MGMTRouteTableAz1:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- MGMTRouteTableAz1
MGMTRouteTableAz2:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- MGMTRouteTableAz2
MGMTRouteIGW1:
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref MGMTRouteTableAz1
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref InternetGateway
MGMTRouteIGW2:
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref MGMTRouteTableAz2
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref InternetGateway
MGMTSubnetRouteTableAssociationNAT1:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
SubnetId: !Ref MGMTSubnetAz1
RouteTableId: !Ref MGMTRouteTableAz1
DependsOn:
- MGMTRouteIGW1
MGMTSubnetRouteTableAssociationNAT2:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
SubnetId: !Ref MGMTSubnetAz2
RouteTableId: !Ref MGMTRouteTableAz2
DependsOn:
- MGMTRouteIGW2
UNTRUSTRouteTableAz1:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- UNTRUSTRouteTableAz1
UNTRUSTRouteTableAz2:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- UNTRUSTRouteTableAz2
UNTRUSTRouteNAT1:
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref UNTRUSTRouteTableAz1
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId: !Ref NAT1
UNTRUSTRouteNAT2:
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref UNTRUSTRouteTableAz2
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId: !Ref NAT2
UNTRUSTSubnetRouteTableAssociationNAT1:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
SubnetId: !Ref UNTRUSTSubnet1
RouteTableId: !Ref UNTRUSTRouteTableAz1
DependsOn:
- UNTRUSTRouteNAT1
UNTRUSTSubnetRouteTableAssociationNAT2:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
SubnetId: !Ref UNTRUSTSubnet2
RouteTableId: !Ref UNTRUSTRouteTableAz2
DependsOn:
- UNTRUSTRouteNAT2
TrustRouteTableAz1:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: TRUST
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- TrustRouteTableAz1
TrustRouteTableAz2:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Application
Value: !Ref 'AWS::StackId'
- Key: Network
Value: TRUST
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- TrustRouteTableAz2
TrustRouteNAT1:
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref TrustRouteTableAz1
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId: !Ref NAT1
TrustRouteNAT2:
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref TrustRouteTableAz2
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId: !Ref NAT2
TRUSTSubnetRouteTableAssociation1:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
SubnetId: !Ref TRUSTSubnet1
RouteTableId: !Ref TrustRouteTableAz1
TRUSTSubnetRouteTableAssociation2:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
SubnetId: !Ref TRUSTSubnet2
RouteTableId: !Ref TrustRouteTableAz2
WebServer1:
Type: 'AWS::EC2::Instance'
Properties:
InstanceType: !Ref WebInstanceType
Tags:
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- WbSvr1
KeyName: !Ref KeyName
ImageId: !FindInMap
- AWSRegionAMIEC2
- !Ref 'AWS::Region'
- Xenial
UserData: !Base64
'Fn::Join':
- ''
- - |
#!/bin/bash
- |
sudo apt-get update -y &&
- |
sudo apt-get install -y apache2 php7.0 libapache2-mod-php7.0 &&
- |
sudo rm -f /var/www/html/index.html &&
- >
sudo wget -O /var/www/html/index.php
https://raw.githubusercontent.com/PaloAltoNetworks/aws-alb-sandwich/master/showheaders.php
NetworkInterfaces:
- DeviceIndex: '0'
GroupSet:
- !Ref sgWideOpen
SubnetId: !Ref TRUSTSubnet1
WebServer2:
Type: 'AWS::EC2::Instance'
Properties:
InstanceType: !Ref WebInstanceType
Tags:
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- WbSvr2
KeyName: !Ref KeyName
ImageId: !FindInMap
- AWSRegionAMIEC2
- !Ref 'AWS::Region'
- Xenial
UserData: !Base64
'Fn::Join':
- ''
- - |
#!/bin/bash
- |
sudo apt-get update -y &&
- |
sudo apt-get install -y apache2 php7.0 libapache2-mod-php7.0 &&
- |
sudo rm -f /var/www/html/index.html &&
- >
sudo wget -O /var/www/html/index.php
https://raw.githubusercontent.com/jasonmeurer/showheaders/master/showheaders.php
NetworkInterfaces:
- DeviceIndex: '0'
GroupSet:
- !Ref sgWideOpen
SubnetId: !Ref TRUSTSubnet2
BootstrapRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: ec2.amazonaws.com
Action: 'sts:AssumeRole'
Path: /
Policies:
- PolicyName: BootstrapRolePolicy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: 's3:ListBucket'
Resource: !Join
- ''
- - 'arn:aws:s3:::'
- !Ref S3BucketName
- Effect: Allow
Action: 's3:GetObject'
Resource: !Join
- ''
- - 'arn:aws:s3:::'
- !Ref S3BucketName
- /*
BootstrapInstanceProfile:
Type: 'AWS::IAM::InstanceProfile'
Properties:
Path: /
Roles:
- !Ref BootstrapRole
FW1ManagementNetworkInterface:
Type: 'AWS::EC2::NetworkInterface'
Properties:
Description: AWS FW1 MGMT
SubnetId: !Ref MGMTSubnetAz1
SourceDestCheck: false
GroupSet:
- !Ref SGforlockdown
Tags:
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- fw1MgmtInt
FW1UntrustNetworkInterface:
Type: 'AWS::EC2::NetworkInterface'
Properties:
Description: AWS FW1 E1/1
SubnetId: !Ref UNTRUSTSubnet1
SourceDestCheck: false
GroupSet:
- !Ref sgWideOpen
Tags:
- Key: Name
Value: !Join
- '-'
- - !Ref 'AWS::StackName'
- fw1UntrustInt
FW1TrustNetworkInterface:
Type: 'AWS::EC2::NetworkInterface'
Properties:
Description: AWS FW1 E1/2
SubnetId: !Ref TRUSTSubnet1
SourceDestCheck: false
GroupSet: