-
Notifications
You must be signed in to change notification settings - Fork 1
/
snort_base.yaml
627 lines (576 loc) · 20.4 KB
/
snort_base.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
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
AWSTemplateFormatVersion: 2010-09-09
Description: Pipeline Automation Template
Parameters:
GitHubOwner:
Type: String
Default: filipeandre
AllowedPattern: "[A-Za-z0-9-]+"
GitHubRepo:
Type: String
Default: aws-gateway-load-balancer-snort3-ips-ids
AllowedPattern: "[A-Za-z0-9-]+"
GitHubBranch:
Type: String
Default: main
AllowedPattern: "[A-Za-z0-9-]+"
VpcName:
Default: ips-service-vpc
Description: Logical name for the filtration and unspection VPC
Type: String
VpcCidr:
AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(1[6-9]|2[0-8]))$"
Default: 192.168.1.0/25
Description: CIDR block for the VPC
Type: String
ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/y
PublicSubnet1Cidr:
AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(1[6-9]|2[0-8]))$"
Default: 192.168.1.0/28
Description: CIDR block for the Public Subnet 1 located in AZ 1
Type: String
ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28
PublicSubnet2Cidr:
AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(1[6-9]|2[0-8]))$"
Default: 192.168.1.16/28
Description: CIDR block for the Public Subnet 2 located in AZ 2
Type: String
ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28
PublicSubnet3Cidr:
AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(1[6-9]|2[0-8]))$"
Default: 192.168.1.32/28
Description: CIDR block for the Public Subnet 3 located in AZ 3
Type: String
ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28
PrivateSubnet1Cidr:
AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(1[6-9]|2[0-8]))$"
Default: 192.168.1.48/28
Description: CIDR block for the Private Subnet 1 located in AZ 1
Type: String
ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28
PrivateSubnet2Cidr:
AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(1[6-9]|2[0-8]))$"
Default: 192.168.1.64/28
Description: CIDR block for the Private Subnet 2 located in AZ 2
Type: String
ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28
PrivateSubnet3Cidr:
AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(1[6-9]|2[0-8]))$"
Default: 192.168.1.80/28
Description: CIDR block for the Private Subnet 3 located in AZ 3
Type: String
ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28
PipelineActions:
Description: >
If CodePipeline actions are going to be ran in Parallel or in sequence.
Parallel is faster but in some special cases, such as using an AWS account provided by AWS for an workshop (Event Engine AWS Account) - CodePipeline might have limits on how many concurrent CodeBuild actions that can be ran in parallel.
In those cases, change the value to 'sequence'.
Default: parallel
AllowedValues:
- parallel
- sequence
Type: String
Oinkcode:
Description: >
Oinkcodes are unique keys associated to your snort3 user account. The oinkcode acts as an api key for downloading rule packages. Please enter your unique oinkcode from your snort.org user account
NoEcho: true
Type: String
HOMENET:
Description: >
Enter the CIDR range of the network you would like to protect. For example, to protect egress traffic from a VPC with CIDR, 10.0.0.0/16, enter 10.0.0.0/16
Type: String
AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$
ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28
Default: 10.0.0.0/16
Conditions:
PipelineActionParallel:
Fn::Equals: [!Ref PipelineActions, parallel]
Resources:
# Pipeline #
SnortEcrRepo:
Type: AWS::ECR::Repository
DeletionPolicy: Retain
SnortBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Retain
Properties:
BucketName: !Sub
- snort-cicd-${AWS::Region}-${AWS::AccountId}-${RandomizedValue}
- RandomizedValue:
Fn::Select: [0, Fn::Split: [-, Fn::Select: [2, Fn::Split: [/, !Ref AWS::StackId ]]]] # Takes the first part of the random GUID in the cloudformation stacks arn.
AccessControl: Private
CPipelineCloudFormationRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
-
Effect: Allow
Principal:
Service:
- cloudformation.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: cfnRolePolicy
PolicyDocument:
Version: 2012-10-17
Statement:
-
Effect: Allow
Action: '*'
Resource: '*'
CPipelineServiceRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service:
- codepipeline.amazonaws.com
Action:
- 'sts:AssumeRole'
Policies:
- PolicyName: CodePipelineRolePolicy
PolicyDocument:
Version: "2012-10-17"
Statement:
- Sid: CodeStarConnectionPolicy
Effect: Allow
Action:
- 'codestar-connections:UseConnection'
Resource: !Ref CodeStarConnection
- Effect: Allow
Action:
- codebuild:StartBuild
- codebuild:BatchGetBuilds
Resource:
- !GetAtt SnortBuildProject.Arn
- Effect: Allow
Action:
- cloudformation:CreateStack
- cloudformation:DeleteStack
- cloudformation:DescribeStacks
- cloudformation:UpdateStack
- cloudformation:CreateChangeSet
- cloudformation:DeleteChangeSet
- cloudformation:DescribeChangeSet
- cloudformation:ExecuteChangeSet
- cloudformation:SetStackPolicy
- cloudformation:ValidateTemplate
Resource: "*"
- Effect: Allow
Action:
- iam:PassRole
Resource:
- !GetAtt CPipelineCloudFormationRole.Arn
- Effect: Allow
Action:
- s3:*
Resource:
- !Sub ${SnortBucket.Arn}
- !Sub ${SnortBucket.Arn}/*
CPipelineCodeBuildRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service:
- codebuild.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: CodebuildRolePolicy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: '*'
- Effect: Allow
Action:
- ecr:PutImage
- ecr:PutImageTagMutability
- ecr:InitiateLayerUpload
- ecr:UploadLayerPart
- ecr:CompleteLayerUpload
- ecr:BatchCheckLayerAvailability
- ecr:GetAuthorizationToken
- ecr:BatchGetImage
- ecr:GetDownloadUrlForLayer
Resource:
- !Sub ${SnortEcrRepo.Arn}
- Effect: Allow
Action:
- ecr:GetAuthorizationToken
Resource: '*'
- Effect: Allow
Action:
- ssm:GetParameter*
- ssm:PutParameter
Resource: !Sub arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/${AWS::StackName}/codebuild/*
- Effect: Allow
Action:
- s3:PutObject
- s3:GetObject
- s3:GetObjectVersion
- s3:GetBucketAcl
- s3:GetBucketLocation
Resource:
- !Sub ${SnortBucket.Arn}
- !Sub ${SnortBucket.Arn}/*
SnortImageUriParameter:
Type: AWS::SSM::Parameter
Properties:
Name: !Sub /${AWS::StackName}/codebuild/container/snort/uri
Type: String
Value: " "
SnortMd5sumParameter:
Type: AWS::SSM::Parameter
Properties:
Name: !Sub /${AWS::StackName}/codebuild/container/snort/md5sum
Type: String
Value: " "
SnortBuildProject:
Type: AWS::CodeBuild::Project
Properties:
Artifacts:
Type: CODEPIPELINE
Environment:
# Type: ARM_CONTAINER
# Image: aws/codebuild/amazonlinux2-aarch64-standard:2.0
Type: LINUX_CONTAINER
Image: aws/codebuild/amazonlinux2-x86_64-standard:4.0
ComputeType: BUILD_GENERAL1_LARGE
PrivilegedMode: true
ImagePullCredentialsType: CODEBUILD
EnvironmentVariables:
- Name: AWS_REGION
Type: PLAINTEXT
Value: !Ref AWS::Region
- Name: MD5SUM_SSM_PARAMETER
Type: PLAINTEXT
Value: !Sub /${AWS::StackName}/codebuild/container/snort/md5sum
- Name: CONTAINERURI_SSM_PARAMETER
Type: PLAINTEXT
Value: !Sub /${AWS::StackName}/codebuild/container/snort/uri
- Name: AWS_ACCOUNT_ID
Type: PLAINTEXT
Value: !Ref AWS::AccountId
- Name: IMAGE_REPO_NAME
Type: PLAINTEXT
Value: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${SnortEcrRepo}
LogsConfig:
CloudWatchLogs:
Status: ENABLED
GroupName: codebuild
ServiceRole: !GetAtt CPipelineCodeBuildRole.Arn
Source:
Type: CODEPIPELINE
BuildSpec: Dockerfiles/snort/buildspec.yml
CodeStarConnection:
Type: 'AWS::CodeStarConnections::Connection'
Properties:
ConnectionName: FilipeGitHubConnection
ProviderType: GitHub
CPipeline:
Type: AWS::CodePipeline::Pipeline
Properties:
ArtifactStore:
Type: S3
Location: !Ref SnortBucket
Name: !Sub ${AWS::StackName}-pipeline
RoleArn: !GetAtt CPipelineServiceRole.Arn
Stages:
- Name: SourceStage
Actions:
- Name: Source
ActionTypeId:
Category: Source
Owner: AWS
Version: 1
Provider: CodeStarSourceConnection
OutputArtifacts:
- Name: SourceArtifact
Configuration:
ConnectionArn: !Ref CodeStarConnection
BranchName: !Ref GitHubBranch
FullRepositoryId: !Sub ${GitHubOwner}/${GitHubRepo}
RunOrder: 1
- Name: BuildStage
Actions:
- Name: Snort
ActionTypeId:
Category: Build
Owner: AWS
Provider: CodeBuild
Version: '1'
Configuration:
ProjectName: !Ref SnortBuildProject
InputArtifacts:
- Name: SourceArtifact
Namespace: SnortBuild
RunOrder: !If [PipelineActionParallel, 1, 2]
- Name: CopyToS3
ActionTypeId:
Category: Deploy
Owner: AWS
Provider: S3
Version: '1'
InputArtifacts:
- Name: SourceArtifact
Configuration:
BucketName: !Ref SnortBucket
Extract: true
ObjectKey: deployment
RunOrder: !If [PipelineActionParallel, 1, 1]
- Name: DeployApplicationStage
Actions:
- Name: CreateChangeSet
ActionTypeId:
Category: Deploy
Owner: AWS
Provider: CloudFormation
Version: '1'
InputArtifacts:
- Name: SourceArtifact
Configuration:
ActionMode: CHANGE_SET_REPLACE
Capabilities: CAPABILITY_IAM
RoleArn: !GetAtt CPipelineCloudFormationRole.Arn
StackName: !Sub ${AWS::StackName}-Snort-cluster
ChangeSetName: !Sub ${AWS::StackName}-Snort-cluster-cset
TemplatePath: SourceArtifact::cloudformation/Snort/cluster.yaml
TemplateConfiguration: SourceArtifact::cloudformation/Snort/cluster-template-configuration.json
ParameterOverrides: !Sub |
{
"VpcId": "${VPC}",
"VpcCidr": "${VpcCidr}",
"PrivateSubnet1": "${PrivateSubnet1}",
"PrivateSubnet2": "${PrivateSubnet2}",
"PrivateSubnet3": "${PrivateSubnet3}",
"SnortImage": "#{SnortBuild.image}",
"Oinkcode": "${Oinkcode}",
"HOMENET": "${HOMENET}"
}
RunOrder: 1
- Name: ExecuteChangeSet
ActionTypeId:
Category: Deploy
Owner: AWS
Provider: CloudFormation
Version: '1'
Configuration:
ActionMode: CHANGE_SET_EXECUTE
ChangeSetName: !Sub ${AWS::StackName}-Snort-cluster-cset
RoleArn: !GetAtt CPipelineCloudFormationRole.Arn
StackName: !Sub ${AWS::StackName}-Snort-cluster
RunOrder: 2
CPipelineCloudWatchEventRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
-
Effect: Allow
Principal:
Service:
- events.amazonaws.com
Action: sts:AssumeRole
Path: /
Policies:
- PolicyName: CWEvenetRolePolicy
PolicyDocument:
Version: 2012-10-17
Statement:
-
Effect: Allow
Action: codepipeline:StartPipelineExecution
Resource: !Sub arn:aws:codepipeline:${AWS::Region}:${AWS::AccountId}:${AWS::StackName}-pipeline
CPipelineCloudWatchEventRule:
Type: AWS::Events::Rule
Properties:
EventPattern:
source:
- aws.codecommit
detail-type:
- 'CodeCommit Repository State Change'
resources:
- !Sub arn:aws:codecommit:${AWS::Region}:${AWS::AccountId}:${AWS::StackName}-repository
detail:
event:
- referenceCreated
- referenceUpdated
referenceType:
- branch
referenceName:
- main
Targets:
- Arn: !Sub arn:aws:codepipeline:${AWS::Region}:${AWS::AccountId}:${AWS::StackName}-pipeline
RoleArn: !GetAtt CPipelineCloudWatchEventRole.Arn
Id: codepipeline-AppPipeline
# Network #
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcCidr
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
- Key: "Name"
Value: !Ref VpcName
InternetGateway:
Type: AWS::EC2::InternetGateway
InternetGatewayAttachment:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
VpcId: !Ref VPC
InternetGatewayId: !Ref InternetGateway
# Public Subnets
PublicSubnet1:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: !Ref PublicSubnet1Cidr
AvailabilityZone: !Select [0, Fn::GetAZs: !Ref 'AWS::Region']
VpcId: !Ref VPC
MapPublicIpOnLaunch: true
PublicSubnet2:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: !Ref PublicSubnet2Cidr
AvailabilityZone: !Select [1, Fn::GetAZs: !Ref 'AWS::Region']
VpcId: !Ref VPC
MapPublicIpOnLaunch: true
PublicSubnet3:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: !Ref PublicSubnet3Cidr
AvailabilityZone: !Select [2, Fn::GetAZs: !Ref 'AWS::Region']
VpcId: !Ref VPC
MapPublicIpOnLaunch: true
PublicSubnetRouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref VPC
PublicSubnetDefaultIPv4Route:
Type: AWS::EC2::Route
Properties:
DestinationCidrBlock: 0.0.0.0/0
RouteTableId: !Ref PublicSubnetRouteTable
GatewayId: !Ref InternetGateway
PublicSubnet1RouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref PublicSubnetRouteTable
SubnetId: !Ref PublicSubnet1
PublicSubnet2RouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref PublicSubnetRouteTable
SubnetId: !Ref PublicSubnet2
PublicSubnet3RouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref PublicSubnetRouteTable
SubnetId: !Ref PublicSubnet3
# NAT
NatGwPublicSubnet1:
Type: AWS::EC2::NatGateway
Properties:
AllocationId: !Sub ${NatGwPublicSubnet1EIP.AllocationId}
SubnetId: !Ref PublicSubnet1
NatGwPublicSubnet1EIP:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
NatGwPublicSubnet2:
Type: AWS::EC2::NatGateway
Properties:
AllocationId: !Sub ${NatGwPublicSubnet2EIP.AllocationId}
SubnetId: !Ref PublicSubnet2
NatGwPublicSubnet2EIP:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
NatGwPublicSubnet3:
Type: AWS::EC2::NatGateway
Properties:
AllocationId: !Sub ${NatGwPublicSubnet3EIP.AllocationId}
SubnetId: !Ref PublicSubnet3
NatGwPublicSubnet3EIP:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
# Private Subnets
PrivateSubnet1:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: !Ref PrivateSubnet1Cidr
AvailabilityZone: !Select [0, Fn::GetAZs: !Ref 'AWS::Region']
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
PrivateSubnet1RouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref VPC
PrivateSubnet1DefaultIPv4Route:
Type: AWS::EC2::Route
Properties:
DestinationCidrBlock: 0.0.0.0/0
RouteTableId: !Ref PrivateSubnet1RouteTable
NatGatewayId: !Ref NatGwPublicSubnet1
PrivateSubnet1RouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref PrivateSubnet1RouteTable
SubnetId: !Ref PrivateSubnet1
PrivateSubnet2:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: !Ref PrivateSubnet2Cidr
AvailabilityZone: !Select [1, Fn::GetAZs: !Ref 'AWS::Region']
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
PrivateSubnet2RouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref VPC
PrivateSubnet2DefaultIPv4Route:
Type: AWS::EC2::Route
Properties:
DestinationCidrBlock: 0.0.0.0/0
RouteTableId: !Ref PrivateSubnet2RouteTable
NatGatewayId: !Ref NatGwPublicSubnet2
PrivateSubnet2RouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref PrivateSubnet2RouteTable
SubnetId: !Ref PrivateSubnet2
PrivateSubnet3:
Type: AWS::EC2::Subnet
Properties:
CidrBlock: !Ref PrivateSubnet3Cidr
AvailabilityZone: !Select [2, Fn::GetAZs: !Ref 'AWS::Region']
VpcId: !Ref VPC
MapPublicIpOnLaunch: false
PrivateSubnet3RouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref VPC
PrivateSubnet3DefaultIPv4Route:
Type: AWS::EC2::Route
Properties:
DestinationCidrBlock: 0.0.0.0/0
RouteTableId: !Ref PrivateSubnet3RouteTable
NatGatewayId: !Ref NatGwPublicSubnet3
PrivateSubnet3RouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref PrivateSubnet3RouteTable
SubnetId: !Ref PrivateSubnet3