Skip to content

Commit e498d8f

Browse files
cgns-gitlab-mirror-app[bot]chkp-avivmchkp-michaeltzchkp-liavb
authored
feat(CGNSPC-1324): AWS | CFT | IPv6 Support | Autoscale. (#556)
Co-authored-by: Aviv Meydan <avivm@checkpoint.com> Co-authored-by: michaeltz <michaeltz@checkpoint.com> Co-authored-by: liavb <liavb@checkpoint.com>
1 parent e010d1e commit e498d8f

3 files changed

Lines changed: 71 additions & 109 deletions

File tree

aws/templates/asg/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
21
## Security Gateway Auto Scaling
2+
33
<table>
44
<thead>
55
<tr>
@@ -19,4 +19,29 @@
1919
</tbody>
2020
</table>
2121
<br/>
22-
<br/>
22+
<br/>
23+
24+
## Revision History
25+
26+
In order to check the template version, please refer to [sk125252](https://support.checkpoint.com/results/sk/sk125252#ToggleR8120gateway)
27+
28+
| Template Version | Description |
29+
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
30+
| 20260310 | Added IPv6 support via IPMode variable. |
31+
| 20260101 | Templates version 20260101 and higher support R82.10 |
32+
| 20250826 | Changed the default solution version to R82-BYOL |
33+
| 20250821 | Added new Auto Scale Group and Management templates for deployments with new VPC |
34+
| 20241225 | Add references to Administration Guides in the description of templates |
35+
| 20241204 | Add support for instance types C7i, M7a, R7a |
36+
| 20241027 | Templates version 20241027 and higher support R82 |
37+
| 20240519 | Add support for requiring use instance metadata service version 2 (IMDSv2) only |
38+
| 20240414 | Add support for Elastic Load Balancer Health Checks |
39+
| 20240131 | Network Load Balancer Health Check configuration change for higher than R81 version. New Health Check Port is 8117 and Protocol TCP |
40+
| 20230923 | Add support for C5d instance type |
41+
| 20230521 | Change default shell for the admin user to /etc/cli.sh |
42+
| 20221226 | Support ASG Launch Template instead of Launch Configuration |
43+
| 20221123 | Templates version 20221123 and higher support R81.20 |
44+
| 20220606 | New instance type support |
45+
| 20210329 | Stability fixes |
46+
| 20210309 | AWS Terraform modules refactor |
47+
| 20200318 | First release of Check Point Auto Scaling Terraform module for AWS |

aws/templates/asg/autoscale-master.yaml

100755100644
Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
AWSTemplateFormatVersion: 2010-09-09
33
Description: |
4-
Create an Auto Scaling group of Check Point gateways into a new VPC (20260302)
4+
Create an Auto Scaling group of Check Point gateways into a new VPC (20260310)
55
See CloudGuard Network for AWS Auto Scale Group deployment guide for detailed deployment and configuration steps.
66
Metadata:
77
AWS::CloudFormation::Interface:
@@ -32,6 +32,7 @@ Metadata:
3232
- PrivateSubnet4CIDR
3333
- AutoScaleGroupName
3434
- GatewayName
35+
- IPMode
3536
- VolumeSize
3637
- VolumeType
3738
- EnableVolumeEncryption
@@ -50,9 +51,6 @@ Metadata:
5051
- ControlGatewayOverPrivateOrPublicAddress
5152
- ManagementServer
5253
- ConfigurationTemplate
53-
- ELBType
54-
- ELBPort
55-
- ELBClients
5654
ParameterLabels:
5755
AvailabilityZones:
5856
default: Availability Zones
@@ -82,6 +80,8 @@ Metadata:
8280
default: Gateways Instance type
8381
KeyName:
8482
default: Key name
83+
IPMode:
84+
default: IP Configuration Mode
8585
VolumeSize:
8686
default: Root volume size (GB)
8787
VolumeType:
@@ -122,12 +122,6 @@ Metadata:
122122
default: Management Server Settings - Management Name
123123
ConfigurationTemplate:
124124
default: Management Server Settings - Configuration template
125-
ELBType:
126-
default: Proxy Settings - Proxy type
127-
ELBPort:
128-
default: Proxy Settings - Proxy port
129-
ELBClients:
130-
default: Proxy Settings - Allowed proxy clients
131125
AutoScaleGroupName:
132126
default: Auto Scale Group name
133127
Parameters:
@@ -431,6 +425,14 @@ Parameters:
431425
Type: AWS::EC2::KeyPair::KeyName
432426
MinLength: 1
433427
ConstraintDescription: Must be the name of an existing EC2 KeyPair.
428+
IPMode:
429+
Description: Specifies the IP mode for the Autoscale Group and AWS resources.
430+
Type: String
431+
AllowedValues:
432+
- IPv4
433+
# - IPv6
434+
- DualStack
435+
Default: IPv4
434436
VolumeSize:
435437
Type: Number
436438
Default: 200
@@ -568,20 +570,6 @@ Parameters:
568570
Default: ASG-configuration
569571
MinLength: 1
570572
MaxLength: 30
571-
ELBType:
572-
Type: String
573-
Default: none
574-
AllowedValues:
575-
- none
576-
- internal
577-
- internet-facing
578-
ELBPort:
579-
Type: Number
580-
Default: 8080
581-
ELBClients:
582-
Type: String
583-
Default: 0.0.0.0/0
584-
AllowedPattern: '^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})$'
585573
AutoScaleGroupName:
586574
Description: The Name of the Auto Scaling Group. (optional)
587575
Type: String
@@ -590,12 +578,13 @@ Parameters:
590578
Conditions:
591579
4AZs: !Equals [!Ref NumberOfAZs, 4]
592580
3AZs: !Or [!Equals [!Ref NumberOfAZs, 3], !Condition 4AZs]
593-
CreateELB: !Not [!Equals [!Ref ELBType, none]]
581+
IsIPv6Enabled: !Not [!Equals [!Ref IPMode, "IPv4"]]
594582
Resources:
595583
VPCStack:
596584
Type: AWS::CloudFormation::Stack
597585
Properties:
598-
TemplateURL: https://cgi-cfts.s3.amazonaws.com/utils/vpc.yaml
586+
TemplateURL:
587+
!If [IsIPv6Enabled, https://cgi-cfts.s3.amazonaws.com/utils/vpc-ipv6.yaml, https://cgi-cfts.s3.amazonaws.com/utils/vpc.yaml]
599588
Parameters:
600589
AvailabilityZones: !Join [',', !Ref AvailabilityZones]
601590
NumberOfAZs: !Ref NumberOfAZs
@@ -608,6 +597,7 @@ Resources:
608597
PrivateSubnet2CIDR: !Ref PrivateSubnet2CIDR
609598
PrivateSubnet3CIDR: !Ref PrivateSubnet3CIDR
610599
PrivateSubnet4CIDR: !Ref PrivateSubnet4CIDR
600+
IPMode: !Ref IPMode
611601
AutoScaleStack:
612602
Type: AWS::CloudFormation::Stack
613603
Properties:
@@ -643,15 +633,9 @@ Resources:
643633
ControlGatewayOverPrivateOrPublicAddress: !Ref ControlGatewayOverPrivateOrPublicAddress
644634
ManagementServer: !Ref ManagementServer
645635
ConfigurationTemplate: !Ref ConfigurationTemplate
646-
ELBType: !Ref ELBType
647-
ELBPort: !Ref ELBPort
648-
ELBClients: !Ref ELBClients
649636
AutoScaleGroupName: !Ref AutoScaleGroupName
637+
IPMode: !Ref IPMode
650638
Outputs:
651-
URL:
652-
Description: The URL of the Proxy.
653-
Condition: CreateELB
654-
Value: !GetAtt AutoScaleStack.Outputs.URL
655639
SecurityGroup:
656640
Description: The Security Group of the Auto Scaling group.
657641
Value: !GetAtt AutoScaleStack.Outputs.SecurityGroup

aws/templates/asg/autoscale.yaml

Lines changed: 27 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
AWSTemplateFormatVersion: 2010-09-09
33
Description: |
4-
Create an Auto Scaling group of Check Point gateways into an existing VPC (20260302)
4+
Create an Auto Scaling group of Check Point gateways into an existing VPC (20260310)
55
See CloudGuard Network for AWS Auto Scale Group deployment guide for detailed deployment and configuration steps
66
Metadata:
77
AWS::CloudFormation::Interface:
@@ -22,6 +22,7 @@ Metadata:
2222
default: Advanced Settings
2323
Parameters:
2424
- GatewayName
25+
- IPMode
2526
- VolumeSize
2627
- VolumeType
2728
- EnableVolumeEncryption
@@ -41,9 +42,6 @@ Metadata:
4142
- ControlGatewayOverPrivateOrPublicAddress
4243
- ManagementServer
4344
- ConfigurationTemplate
44-
- ELBType
45-
- ELBPort
46-
- ELBClients
4745
ParameterLabels:
4846
VPC:
4947
default: VPC
@@ -55,6 +53,8 @@ Metadata:
5553
default: Gateways Instance type
5654
KeyName:
5755
default: Key name
56+
IPMode:
57+
default: IP Configuration Mode
5858
VolumeSize:
5959
default: Root volume size (GB)
6060
VolumeType:
@@ -95,12 +95,6 @@ Metadata:
9595
default: Management Server Settings - Server
9696
ConfigurationTemplate:
9797
default: Management Server Settings - Configuration template
98-
ELBType:
99-
default: Proxy Settings - Proxy type
100-
ELBPort:
101-
default: Proxy Settings - Proxy port
102-
ELBClients:
103-
default: Proxy Settings - Allowed proxy clients
10498
AutoScaleGroupName:
10599
default: Auto Scale Group name
106100
Parameters:
@@ -346,6 +340,14 @@ Parameters:
346340
Type: AWS::EC2::KeyPair::KeyName
347341
MinLength: 1
348342
ConstraintDescription: Must be the name of an existing EC2 KeyPair.
343+
IPMode:
344+
Description: Specifies the IP mode for the Autoscale Group and AWS resources.
345+
Type: String
346+
AllowedValues:
347+
- IPv4
348+
# - IPv6
349+
- DualStack
350+
Default: IPv4
349351
VolumeSize:
350352
Type: Number
351353
Default: 200
@@ -483,33 +485,19 @@ Parameters:
483485
Default: ASG-configuration
484486
MinLength: 1
485487
MaxLength: 30
486-
ELBType:
487-
Type: String
488-
Default: none
489-
AllowedValues:
490-
- none
491-
- internal
492-
- internet-facing
493-
ELBPort:
494-
Type: Number
495-
Default: 8080
496-
ELBClients:
497-
Type: String
498-
Default: 0.0.0.0/0
499-
AllowedPattern: '^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})$'
500488
AutoScaleGroupName:
501489
Description: The Name of the Auto Scaling Group. (optional)
502490
Type: String
503491
Default: ""
504492
MaxLength: 100
505-
506493
Conditions:
507494
ProvidedAdminEmail: !Not [!Equals [!Ref AdminEmail, '']]
508495
ProvidedTargetGroups: !Not [!Equals [!Ref GatewaysTargetGroups, '']]
509496
EnableCloudWatch: !Equals [!Ref CloudWatch, true]
510-
CreateELB: !Not [!Equals [!Ref ELBType, none]]
511497
EnableMetaDataToken: !Equals [!Ref MetaDataToken, true]
512498
GenerateAutoScalingName: !Equals [!Ref AutoScaleGroupName, ""]
499+
IsIPv6Enabled: !Not [!Equals [!Ref IPMode, "IPv4"]]
500+
IsIPv4Enabled: !Not [!Equals [!Ref IPMode, "IPv6"]]
513501
Resources:
514502
ChkpGatewayRole:
515503
Type: AWS::IAM::Role
@@ -553,33 +541,6 @@ Resources:
553541
Subscription:
554542
- Endpoint: !Ref AdminEmail
555543
Protocol: email
556-
ElasticLoadBalancer:
557-
Type: AWS::ElasticLoadBalancing::LoadBalancer
558-
Condition: CreateELB
559-
Properties:
560-
CrossZone: true
561-
Listeners:
562-
- LoadBalancerPort: !Ref ELBPort
563-
InstancePort: !Ref ELBPort
564-
Protocol: TCP
565-
HealthCheck:
566-
Target: !Join [':', [TCP, !Ref ELBPort]]
567-
HealthyThreshold: 3
568-
UnhealthyThreshold: 5
569-
Interval: 30
570-
Timeout: 5
571-
Scheme: !Ref ELBType
572-
Subnets: !Ref GatewaysSubnets
573-
Policies:
574-
- PolicyName: EnableProxyProtocol
575-
PolicyType: ProxyProtocolPolicyType
576-
Attributes:
577-
- Name: ProxyProtocol
578-
Value: true
579-
InstancePorts:
580-
- !Ref ELBPort
581-
SecurityGroups:
582-
- !Ref ELBSecurityGroup
583544
PermissiveSecurityGroup:
584545
Type: AWS::EC2::SecurityGroup
585546
Properties:
@@ -589,8 +550,16 @@ Resources:
589550
GroupDescription: Permissive security group.
590551
VpcId: !Ref VPC
591552
SecurityGroupIngress:
592-
- IpProtocol: -1
593-
CidrIp: 0.0.0.0/0
553+
- !If
554+
- IsIPv4Enabled
555+
- IpProtocol: -1
556+
CidrIp: 0.0.0.0/0
557+
- !Ref "AWS::NoValue"
558+
- !If
559+
- IsIPv6Enabled
560+
- IpProtocol: -1
561+
CidrIpv6: ::/0
562+
- !Ref "AWS::NoValue"
594563
GatewayGroup:
595564
Type: AWS::AutoScaling::AutoScalingGroup
596565
Properties:
@@ -601,7 +570,6 @@ Resources:
601570
AutoScalingGroupName: !If [GenerateAutoScalingName, !Join ["-", [!Ref 'AWS::StackName', GatewayGroup]], !Ref AutoScaleGroupName]
602571
MinSize: !Ref GatewaysMinSize
603572
MaxSize: !Ref GatewaysMaxSize
604-
LoadBalancerNames: !If [CreateELB, [!Ref ElasticLoadBalancer], !Ref 'AWS::NoValue']
605573
TargetGroupARNs: !If [ProvidedTargetGroups, !Split [',', !Ref GatewaysTargetGroups], !Ref 'AWS::NoValue']
606574
HealthCheckGracePeriod: 3600
607575
HealthCheckType: ELB
@@ -631,7 +599,8 @@ Resources:
631599
LaunchTemplateData:
632600
NetworkInterfaces:
633601
- DeviceIndex: 0
634-
AssociatePublicIpAddress: true
602+
AssociatePublicIpAddress: !If [IsIPv4Enabled, true, false]
603+
Ipv6AddressCount: !If [IsIPv6Enabled, 1, !Ref "AWS::NoValue"]
635604
Groups:
636605
- !Ref PermissiveSecurityGroup
637606
Monitoring:
@@ -668,7 +637,7 @@ Resources:
668637
- !Join ['', [' maintenance_pwd_hash="$(echo ', 'Fn::Base64': !Ref GatewayMaintenancePasswordHash, ')"']]
669638
- !Join ['', [' bootstrap="$(echo ', 'Fn::Base64': !Ref GatewayBootstrapScript, ')"']]
670639
- !Sub [' version=${Version}', {Version: !Select [0, !Split ['-', !Ref GatewayVersion]]}]
671-
- ' python3 /etc/cloud_config.py enableCloudWatch=\"${cw}\" sicKey=\"${sic}\" installationType=\"autoscale\" osVersion=\"${version}\" allowUploadDownload=\"${allow_info}\" templateVersion=\"20260302\" templateName=\"${template_name}\" shell=\"${admin_shell}\" enableInstanceConnect=\"${eic}\" passwordHash=\"${pwd_hash}\" MaintenanceModePassword=\"${maintenance_pwd_hash}\" bootstrapScript64=\"${bootstrap}\"'
640+
- ' python3 /etc/cloud_config.py enableCloudWatch=\"${cw}\" sicKey=\"${sic}\" installationType=\"autoscale\" osVersion=\"${version}\" allowUploadDownload=\"${allow_info}\" templateVersion=\"20260310\" templateName=\"${template_name}\" shell=\"${admin_shell}\" enableInstanceConnect=\"${eic}\" passwordHash=\"${pwd_hash}\" MaintenanceModePassword=\"${maintenance_pwd_hash}\" bootstrapScript64=\"${bootstrap}\"'
672641
VersionDescription: Initial template version
673642
GatewayScaleUpPolicy:
674643
Type: AWS::AutoScaling::ScalingPolicy
@@ -716,23 +685,7 @@ Resources:
716685
- Name: AutoScalingGroupName
717686
Value: !Ref GatewayGroup
718687
ComparisonOperator: LessThanThreshold
719-
ELBSecurityGroup:
720-
Type: AWS::EC2::SecurityGroup
721-
Condition: CreateELB
722-
Properties:
723-
GroupDescription: ELB security group.
724-
VpcId: !Ref VPC
725-
SecurityGroupIngress:
726-
- IpProtocol: tcp
727-
CidrIp: !Ref ELBClients
728-
FromPort: !Ref ELBPort
729-
ToPort: !Ref ELBPort
730688
Outputs:
731-
URL:
732-
Description: The URL of the Proxy.
733-
Condition: CreateELB
734-
Value: !Join ['', ['http://', !GetAtt ElasticLoadBalancer.DNSName]]
735689
SecurityGroup:
736690
Description: The Security Group of the Auto Scaling group.
737691
Value: !GetAtt PermissiveSecurityGroup.GroupId
738-

0 commit comments

Comments
 (0)