Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align master #409

Merged
merged 8 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions aws/templates/asg/autoscale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Metadata:
- VolumeType
- EnableVolumeEncryption
- EnableInstanceConnect
- MetaDataToken
- Label:
default: Auto Scaling Configuration
Parameters:
Expand Down Expand Up @@ -67,6 +68,8 @@ Metadata:
default: Enable volume encryption
EnableInstanceConnect:
default: Enable AWS Instance Connect
MetaDataToken:
default: Metadata HTTP token
GatewaysMinSize:
default: Minimum Gateway group size
GatewaysMaxSize:
Expand Down Expand Up @@ -119,7 +122,7 @@ Parameters:
GatewayInstanceType:
Description: The instance type of the Secutiry Gateways.
Type: String
Default: c5.xlarge
Default: c6in.xlarge
AllowedValues:
- c4.large
- c4.xlarge
Expand Down Expand Up @@ -262,6 +265,13 @@ Parameters:
AllowedValues:
- true
- false
MetaDataToken:
Description: Set true to deploy the instance with metadata v2 token required.
Type: String
Default: true
AllowedValues:
- true
- false
GatewaysMinSize:
Description: The minimal number of gateways in the Auto Scaling group.
Type: Number
Expand All @@ -287,12 +297,6 @@ Parameters:
Type: String
Default: R81.20-BYOL
AllowedValues:
- R80.40-BYOL
- R80.40-PAYG-NGTP
- R80.40-PAYG-NGTX
- R81-BYOL
- R81-PAYG-NGTP
- R81-PAYG-NGTX
- R81.10-BYOL
- R81.10-PAYG-NGTP
- R81.10-PAYG-NGTX
Expand Down Expand Up @@ -386,6 +390,7 @@ Conditions:
ProvidedTargetGroups: !Not [!Equals [!Ref GatewaysTargetGroups, '']]
EnableCloudWatch: !Equals [!Ref CloudWatch, true]
CreateELB: !Not [!Equals [!Ref ELBType, none]]
EnableMetaDataToken: !Equals [!Ref MetaDataToken, true]
Resources:
ChkpGatewayRole:
Type: AWS::IAM::Role
Expand Down Expand Up @@ -515,6 +520,8 @@ Resources:
KeyName: !Ref KeyName
ImageId: !GetAtt AMI.Outputs.ImageId
InstanceType: !Ref GatewayInstanceType
MetadataOptions:
HttpTokens: !If [EnableMetaDataToken, required, optional]
BlockDeviceMappings:
- DeviceName: '/dev/xvda'
Ebs:
Expand Down
19 changes: 12 additions & 7 deletions aws/templates/cluster/cluster-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Metadata:
- EnableInstanceConnect
- GatewayPredefinedRole
- TerminationProtection
- MetaDataToken
- Label:
default: Check Point Settings
Parameters:
Expand Down Expand Up @@ -75,6 +76,8 @@ Metadata:
default: Existing IAM role name
TerminationProtection:
default: Termination Protection
MetaDataToken:
default: Metadata HTTP token
GatewayVersion:
default: Version & license
Shell:
Expand Down Expand Up @@ -133,7 +136,7 @@ Parameters:
GatewayInstanceType:
Description: The instance type of the Secutiry Gateway.
Type: String
Default: c5.xlarge
Default: c6in.xlarge
AllowedValues:
- c4.large
- c4.xlarge
Expand Down Expand Up @@ -290,16 +293,17 @@ Parameters:
AllowedValues:
- true
- false
MetaDataToken:
Description: Set true to deploy the instance with metadata v2 token required.
Type: String
Default: true
AllowedValues:
- true
- false
GatewayVersion:
Type: String
Default: R81.20-BYOL
AllowedValues:
- R80.40-BYOL
- R80.40-PAYG-NGTP
- R80.40-PAYG-NGTX
- R81-BYOL
- R81-PAYG-NGTP
- R81-PAYG-NGTX
- R81.10-BYOL
- R81.10-PAYG-NGTP
- R81.10-PAYG-NGTX
Expand Down Expand Up @@ -426,6 +430,7 @@ Resources:
EnableInstanceConnect: !Ref EnableInstanceConnect
GatewayPredefinedRole: !Ref GatewayPredefinedRole
TerminationProtection: !Ref TerminationProtection
MetaDataToken: !Ref MetaDataToken
GatewayVersion: !Ref GatewayVersion
Shell: !Ref Shell
GatewayPasswordHash: !Ref GatewayPasswordHash
Expand Down
186 changes: 107 additions & 79 deletions aws/templates/cluster/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Metadata:
- EnableInstanceConnect
- GatewayPredefinedRole
- TerminationProtection
- MetaDataToken
- Label:
default: Check Point Settings
Parameters:
Expand Down Expand Up @@ -75,6 +76,8 @@ Metadata:
default: Existing IAM role name
TerminationProtection:
default: Termination Protection
MetaDataToken:
default: Metadata HTTP token
GatewayVersion:
default: Version & license
Shell:
Expand Down Expand Up @@ -127,7 +130,7 @@ Parameters:
GatewayInstanceType:
Description: The instance type of the Secutiry Gateway.
Type: String
Default: c5.xlarge
Default: c6in.xlarge
AllowedValues:
- c4.large
- c4.xlarge
Expand Down Expand Up @@ -285,16 +288,17 @@ Parameters:
AllowedValues:
- true
- false
MetaDataToken:
Description: Set true to deploy the instance with metadata v2 token required.
Type: String
Default: true
AllowedValues:
- true
- false
GatewayVersion:
Type: String
Default: R81.20-BYOL
AllowedValues:
- R80.40-BYOL
- R80.40-PAYG-NGTP
- R80.40-PAYG-NGTX
- R81-BYOL
- R81-PAYG-NGTP
- R81-PAYG-NGTX
- R81.10-BYOL
- R81.10-PAYG-NGTP
- R81.10-PAYG-NGTX
Expand Down Expand Up @@ -390,6 +394,7 @@ Conditions:
ProvidedResourcesTag: !Not [!Equals [!Ref ResourcesTagName, '']]
EmptyHostName: !Equals [!Ref GatewayHostname, '']
EnableCloudWatch: !Equals [!Ref CloudWatch, true]
EnableMetaDataToken: !Equals [!Ref MetaDataToken, true]
Resources:
ClusterReadyHandle:
Type: AWS::CloudFormation::WaitConditionHandle
Expand Down Expand Up @@ -520,8 +525,12 @@ Resources:
SubnetId: !Ref PrivateSubnet
MemberAInstance:
Type: AWS::EC2::Instance
DependsOn: [MemberAExternalInterface, MemberAInternalInterface]
DependsOn: [MemberAExternalInterface, MemberAInternalInterface, MemberAGatewayLaunchTemplate]
Properties:
LaunchTemplate:
LaunchTemplateId: !Ref MemberAGatewayLaunchTemplate
Version: !GetAtt MemberAGatewayLaunchTemplate.LatestVersionNumber
DisableApiTermination: !Ref TerminationProtection
Tags:
- Key: Name
Value: !Join ['-', [!Ref GatewayName, Member-A]]
Expand All @@ -537,46 +546,14 @@ Resources:
- - !Join [ '=', [ cluster-ip, !Ref ClusterPublicAddress ] ]
- !Join [ '=', [ cluster-eth0-private-ip, !Select [ 0, !GetAtt MemberAExternalInterface.SecondaryPrivateIpAddresses ] ] ]
- !Join [ '=', [ cluster-eth1-private-ip, !Select [ 0, !GetAtt MemberAInternalInterface.SecondaryPrivateIpAddresses ] ] ]
ImageId: !GetAtt AMI.Outputs.ImageId
InstanceType: !Ref GatewayInstanceType
BlockDeviceMappings:
- DeviceName: '/dev/xvda'
Ebs:
Encrypted: !If [EncryptedVolume, true, false]
KmsKeyId: !If [EncryptedVolume, !Ref VolumeEncryption, !Ref 'AWS::NoValue']
VolumeType: !Ref VolumeType
VolumeSize: !Ref VolumeSize
KeyName: !Ref KeyName
NetworkInterfaces:
- DeviceIndex: 0
NetworkInterfaceId: !Ref MemberAExternalInterface
- DeviceIndex: 1
NetworkInterfaceId: !Ref MemberAInternalInterface
IamInstanceProfile: !Ref ClusterInstanceProfile
DisableApiTermination: !Ref TerminationProtection
UserData:
'Fn::Base64':
!Join
- |+

- - '#cloud-config'
- 'runcmd:'
- ' - |'
- ' set -e'
- !Sub ' admin_shell=${Shell} ; allow_info=${AllowUploadDownload} ; cw=${CloudWatch} ; eic=${EnableInstanceConnect} ; ntp1=${NTPPrimary} ; ntp2=${NTPSecondary} ; tokenA=''${MemberAToken}'''
- !If [AllocateAddress, !Sub ' wait_handle=''${ClusterReadyHandle}''',!Ref 'AWS::NoValue']
- !If [EmptyHostName, ' hostname=""',!Sub ' hostname=${GatewayHostname}-member-a']
- !Join ['', [' eip="', !If [AllocateAddress, !Ref MemberAPublicAddress, ''], '"']]
- !Join ['', [' sic="$(echo ', 'Fn::Base64': !Ref GatewaySICKey, ')"']]
- !Join ['', [' pwd_hash="$(echo ', 'Fn::Base64': !Ref GatewayPasswordHash, ')"']]
- !Join ['', [' maintenance_pwd_hash="$(echo ', 'Fn::Base64': !Ref GatewayMaintenancePasswordHash, ')"']]
- !Join ['', [' bootstrap="$(echo ', 'Fn::Base64': !Ref GatewayBootstrapScript, ')"']]
- !Sub [' version=${Version}', {Version: !Select [0, !Split ['-', !Ref GatewayVersion]]}]
- ' python3 /etc/cloud_config.py enableCloudWatch=\"${cw}\" waitHandle=\"${wait_handle}\" sicKey=\"${sic}\" "smart1CloudToken=\"${tokenA}\"" installationType=\"cluster\" osVersion=\"${version}\" allowUploadDownload=\"${allow_info}\" templateVersion=\"20240204\" templateName=\"cluster\" shell=\"${admin_shell}\" enableInstanceConnect=\"${eic}\" hostName=\"${hostname}\" ntpPrimary=\"${ntp1}\" ntpSecondary=\"${ntp2}\" passwordHash=\"${pwd_hash}\" MaintenanceModePassword=\"${maintenance_pwd_hash}\" elasticIp=\"${eip}\" bootstrapScript64=\"${bootstrap}\"'
MemberBInstance:
Type: AWS::EC2::Instance
DependsOn: [MemberBExternalInterface, MemberBInternalInterface]
DependsOn: [MemberBExternalInterface, MemberBInternalInterface, MemberBGatewayLaunchTemplate]
Properties:
LaunchTemplate:
LaunchTemplateId: !Ref MemberBGatewayLaunchTemplate
Version: !GetAtt MemberBGatewayLaunchTemplate.LatestVersionNumber
DisableApiTermination: !Ref TerminationProtection
Tags:
- Key: Name
Value: !Join ['-', [!Ref GatewayName, Member-B]]
Expand All @@ -592,41 +569,92 @@ Resources:
- - !Join [ '=', [ cluster-ip, !Ref ClusterPublicAddress ] ]
- !Join [ '=', [ cluster-eth0-private-ip, !Select [ 0, !GetAtt MemberAExternalInterface.SecondaryPrivateIpAddresses ] ] ]
- !Join [ '=', [ cluster-eth1-private-ip, !Select [ 0, !GetAtt MemberAInternalInterface.SecondaryPrivateIpAddresses ] ] ]
ImageId: !GetAtt AMI.Outputs.ImageId
InstanceType: !Ref GatewayInstanceType
BlockDeviceMappings:
- DeviceName: '/dev/xvda'
Ebs:
Encrypted: !If [EncryptedVolume, true, false]
KmsKeyId: !If [EncryptedVolume, !Ref VolumeEncryption, !Ref 'AWS::NoValue']
VolumeType: !Ref VolumeType
VolumeSize: !Ref VolumeSize
KeyName: !Ref KeyName
NetworkInterfaces:
- DeviceIndex: 0
NetworkInterfaceId: !Ref MemberBExternalInterface
- DeviceIndex: 1
NetworkInterfaceId: !Ref MemberBInternalInterface
IamInstanceProfile: !Ref ClusterInstanceProfile
DisableApiTermination: !Ref TerminationProtection
UserData:
'Fn::Base64':
!Join
- |+
MemberAGatewayLaunchTemplate:
Type: AWS::EC2::LaunchTemplate
Properties:
LaunchTemplateData:
NetworkInterfaces:
- DeviceIndex: 0
NetworkInterfaceId: !Ref MemberAExternalInterface
- DeviceIndex: 1
NetworkInterfaceId: !Ref MemberAInternalInterface
KeyName: !Ref KeyName
ImageId: !GetAtt AMI.Outputs.ImageId
InstanceType: !Ref GatewayInstanceType
MetadataOptions:
HttpTokens: !If [EnableMetaDataToken, required, optional]
BlockDeviceMappings:
- DeviceName: '/dev/xvda'
Ebs:
Encrypted: !If [ EncryptedVolume, true, false ]
KmsKeyId: !If [ EncryptedVolume, !Ref VolumeEncryption, !Ref 'AWS::NoValue' ]
VolumeType: !Ref VolumeType
VolumeSize: !Ref VolumeSize
IamInstanceProfile:
Name: !Ref ClusterInstanceProfile
UserData:
'Fn::Base64':
!Join
- |+

- - '#cloud-config'
- 'runcmd:'
- ' - |'
- ' set -e'
- !Sub ' admin_shell=${Shell} ; allow_info=${AllowUploadDownload} ; cw=${CloudWatch} ; eic=${EnableInstanceConnect} ; ntp1=${NTPPrimary} ; ntp2=${NTPSecondary} ; tokenA=''${MemberAToken}'''
- !If [AllocateAddress, !Sub ' wait_handle=''${ClusterReadyHandle}''',!Ref 'AWS::NoValue']
- !If [EmptyHostName, ' hostname=""',!Sub ' hostname=${GatewayHostname}-member-a']
- !Join ['', [' eip="', !If [AllocateAddress, !Ref MemberAPublicAddress, ''], '"']]
- !Join ['', [' sic="$(echo ', 'Fn::Base64': !Ref GatewaySICKey, ')"']]
- !Join ['', [' pwd_hash="$(echo ', 'Fn::Base64': !Ref GatewayPasswordHash, ')"']]
- !Join ['', [' maintenance_pwd_hash="$(echo ', 'Fn::Base64': !Ref GatewayMaintenancePasswordHash, ')"']]
- !Join ['', [' bootstrap="$(echo ', 'Fn::Base64': !Ref GatewayBootstrapScript, ')"']]
- !Sub [' version=${Version}', {Version: !Select [0, !Split ['-', !Ref GatewayVersion]]}]
- ' python3 /etc/cloud_config.py enableCloudWatch=\"${cw}\" waitHandle=\"${wait_handle}\" sicKey=\"${sic}\" "smart1CloudToken=\"${tokenA}\"" installationType=\"cluster\" osVersion=\"${version}\" allowUploadDownload=\"${allow_info}\" templateVersion=\"20240204\" templateName=\"cluster\" shell=\"${admin_shell}\" enableInstanceConnect=\"${eic}\" hostName=\"${hostname}\" ntpPrimary=\"${ntp1}\" ntpSecondary=\"${ntp2}\" passwordHash=\"${pwd_hash}\" MaintenanceModePassword=\"${maintenance_pwd_hash}\" elasticIp=\"${eip}\" bootstrapScript64=\"${bootstrap}\"'
VersionDescription: Initial template version
MemberBGatewayLaunchTemplate:
Type: AWS::EC2::LaunchTemplate
Properties:
LaunchTemplateData:
NetworkInterfaces:
- DeviceIndex: 0
NetworkInterfaceId: !Ref MemberBExternalInterface
- DeviceIndex: 1
NetworkInterfaceId: !Ref MemberBInternalInterface
KeyName: !Ref KeyName
ImageId: !GetAtt AMI.Outputs.ImageId
InstanceType: !Ref GatewayInstanceType
MetadataOptions:
HttpTokens: !If [EnableMetaDataToken, required, optional]
BlockDeviceMappings:
- DeviceName: '/dev/xvda'
Ebs:
Encrypted: !If [ EncryptedVolume, true, false ]
KmsKeyId: !If [ EncryptedVolume, !Ref VolumeEncryption, !Ref 'AWS::NoValue' ]
VolumeType: !Ref VolumeType
VolumeSize: !Ref VolumeSize
IamInstanceProfile:
Name: !Ref ClusterInstanceProfile
UserData:
'Fn::Base64':
!Join
- |+

- - '#cloud-config'
- 'runcmd:'
- ' - |'
- ' set -e'
- !Sub ' admin_shell=${Shell} ; allow_info=${AllowUploadDownload} ; cw=${CloudWatch} ; eic=${EnableInstanceConnect} ; ntp1=${NTPPrimary} ; ntp2=${NTPSecondary} ; tokenB=''${MemberBToken}'''
- !If [AllocateAddress, !Sub ' wait_handle=''${ClusterReadyHandle}''',!Ref 'AWS::NoValue']
- !If [EmptyHostName, ' hostname=""',!Sub ' hostname=${GatewayHostname}-member-b']
- !Join ['', [' eip="', !If [AllocateAddress, !Ref MemberBPublicAddress, ''], '"']]
- !Join ['', [' sic="$(echo ', 'Fn::Base64': !Ref GatewaySICKey, ')"']]
- !Join ['', [' pwd_hash="$(echo ', 'Fn::Base64': !Ref GatewayPasswordHash, ')"']]
- !Join ['', [' bootstrap="$(echo ', 'Fn::Base64': !Ref GatewayBootstrapScript, ')"']]
- !Sub [' version=${Version}', {Version: !Select [0, !Split ['.', !Select [0, !Split ['-', !Ref GatewayVersion]]]]}]
- ' python3 /etc/cloud_config.py enableCloudWatch=\"${cw}\" waitHandle=\"${wait_handle}\" sicKey=\"${sic}\" "smart1CloudToken=\"${tokenB}\"" installationType=\"cluster\" osVersion=\"${version}\" allowUploadDownload=\"${allow_info}\" templateVersion=\"20230923\" templateName=\"cluster\" shell=\"${admin_shell}\" enableInstanceConnect=\"${eic}\" hostName=\"${hostname}\" ntpPrimary=\"${ntp1}\" ntpSecondary=\"${ntp2}\" passwordHash=\"${pwd_hash}\" elasticIp=\"${eip}\" bootstrapScript64=\"${bootstrap}\"'
- - '#cloud-config'
- 'runcmd:'
- ' - |'
- ' set -e'
- !Sub ' admin_shell=${Shell} ; allow_info=${AllowUploadDownload} ; cw=${CloudWatch} ; eic=${EnableInstanceConnect} ; ntp1=${NTPPrimary} ; ntp2=${NTPSecondary} ; tokenB=''${MemberBToken}'''
- !If [AllocateAddress, !Sub ' wait_handle=''${ClusterReadyHandle}''',!Ref 'AWS::NoValue']
- !If [EmptyHostName, ' hostname=""',!Sub ' hostname=${GatewayHostname}-member-b']
- !Join ['', [' eip="', !If [AllocateAddress, !Ref MemberBPublicAddress, ''], '"']]
- !Join ['', [' sic="$(echo ', 'Fn::Base64': !Ref GatewaySICKey, ')"']]
- !Join ['', [' pwd_hash="$(echo ', 'Fn::Base64': !Ref GatewayPasswordHash, ')"']]
- !Join ['', [' maintenance_pwd_hash="$(echo ', 'Fn::Base64': !Ref GatewayMaintenancePasswordHash, ')"']]
- !Join ['', [' bootstrap="$(echo ', 'Fn::Base64': !Ref GatewayBootstrapScript, ')"']]
- !Sub [' version=${Version}', {Version: !Select [0, !Split ['-', !Ref GatewayVersion]]}]
- ' python3 /etc/cloud_config.py enableCloudWatch=\"${cw}\" waitHandle=\"${wait_handle}\" sicKey=\"${sic}\" "smart1CloudToken=\"${tokenB}\"" installationType=\"cluster\" osVersion=\"${version}\" allowUploadDownload=\"${allow_info}\" templateVersion=\"20230923\" templateName=\"cluster\" shell=\"${admin_shell}\" enableInstanceConnect=\"${eic}\" hostName=\"${hostname}\" ntpPrimary=\"${ntp1}\" ntpSecondary=\"${ntp2}\" passwordHash=\"${pwd_hash}\" MaintenanceModePassword=\"${maintenance_pwd_hash}\" elasticIp=\"${eip}\" bootstrapScript64=\"${bootstrap}\"'
VersionDescription: Initial template version
ClusterPublicAddress:
Type: AWS::EC2::EIP
Properties:
Expand Down
Loading
Loading