diff --git a/aws/templates/general/cme-iam-role.yaml b/aws/templates/general/cme-iam-role.yaml
index 2c9df40c..d87c1e16 100755
--- a/aws/templates/general/cme-iam-role.yaml
+++ b/aws/templates/general/cme-iam-role.yaml
@@ -1,5 +1,5 @@
AWSTemplateFormatVersion: 2010-09-09
-Description: Creates an IAM role for selected permissions (20211212)
+Description: Creates an IAM role for selected permissions (20230926)
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
@@ -143,9 +143,9 @@ Resources:
InstanceProfile:
Type: AWS::IAM::InstanceProfile
Properties:
- InstanceProfileName: !Ref CMEIAMRole
- Roles:
- - !Ref CMEIAMRole
+ InstanceProfileName: !Ref CMEIAMRole
+ Roles:
+ - !Ref CMEIAMRole
Outputs:
CMEIAMRole:
Description: The IAM role.
diff --git a/aws/templates/management/management.yaml b/aws/templates/management/management.yaml
index df128992..d0e5ac77 100755
--- a/aws/templates/management/management.yaml
+++ b/aws/templates/management/management.yaml
@@ -1,5 +1,5 @@
AWSTemplateFormatVersion: 2010-09-09
-Description: Deploys a Check Point Management Server (20230830)
+Description: Deploys a Check Point Management Server (20230926)
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
@@ -395,6 +395,7 @@ Conditions:
EncryptedVolume: !Not [!Equals [!Ref VolumeEncryption, '']]
UseRole: !Not [!Equals [!Ref ManagementPermissions, None (configure later)]]
NoSIC: !Equals [!Ref ManagementSICKey, '']
+ PreRole: !And [!Condition UseRole, !Not [!Condition CreateRole]]
Resources:
AMI:
Type: AWS::CloudFormation::Stack
@@ -477,11 +478,11 @@ Resources:
STSRoles: !Join [',', !Ref ManagementSTSRoles]
InstanceProfile:
Type: AWS::IAM::InstanceProfile
- Condition: UseRole
+ Condition: PreRole
Properties:
Path: /
Roles:
- - !If [CreateRole, !GetAtt ManagementRoleStack.Outputs.CMEIAMRole, !Ref ManagementPredefinedRole]
+ - !Ref ManagementPredefinedRole
ManagementInstance:
Type: AWS::EC2::Instance
DependsOn: ManagementSecurityGroup
@@ -491,7 +492,7 @@ Resources:
Value: !Ref ManagementName
ImageId: !GetAtt AMI.Outputs.ImageId
InstanceType: !Ref ManagementInstanceType
- IamInstanceProfile: !If [UseRole, !Ref InstanceProfile, !Ref 'AWS::NoValue']
+ IamInstanceProfile: !If [UseRole, !If [PreRole, !Ref InstanceProfile, !GetAtt ManagementRoleStack.Outputs.CMEIAMRole], !Ref 'AWS::NoValue']
KeyName: !Ref KeyName
NetworkInterfaces:
- DeviceIndex: 0
diff --git a/aws/templates/mds/mds.yaml b/aws/templates/mds/mds.yaml
index 78dd4ab9..90b47f81 100755
--- a/aws/templates/mds/mds.yaml
+++ b/aws/templates/mds/mds.yaml
@@ -1,5 +1,5 @@
AWSTemplateFormatVersion: '2010-09-09'
-Description: Deploys a Check Point Multi-Domain Server (20230830)
+Description: Deploys a Check Point Multi-Domain Server (20230926)
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
@@ -375,6 +375,7 @@ Conditions:
UseRole: !And [!Or [!Condition PrimaryMDS, !Condition SecondaryMDS], !Not [!Equals [!Ref MDSPermissions, None (configure later)]]]
PrimaryMDS: !Equals [!Ref MDSInstallationType, Primary Multi-Domain Server]
SecondaryMDS: !Equals [!Ref MDSInstallationType, Secondary Multi-Domain Server]
+ PreRole: !And [!Condition UseRole, !Not [!Condition CreateRole]]
Resources:
AMI:
Type: AWS::CloudFormation::Stack
@@ -446,11 +447,11 @@ Resources:
STSRoles: !Join [',', !Ref MDSSTSRoles]
InstanceProfile:
Type: AWS::IAM::InstanceProfile
- Condition: UseRole
+ Condition: PreRole
Properties:
Path: /
Roles:
- - !If [CreateRole, !GetAtt MDSRoleStack.Outputs.CMEIAMRole, !Ref MDSPredefinedRole]
+ - !Ref MDSPredefinedRole
MDSInstance:
Type: AWS::EC2::Instance
DependsOn: MDSSecurityGroup
@@ -460,7 +461,7 @@ Resources:
Value: !Ref MDSName
ImageId: !GetAtt AMI.Outputs.ImageId
InstanceType: !Ref MDSInstanceType
- IamInstanceProfile: !If [UseRole, !Ref InstanceProfile, !Ref 'AWS::NoValue']
+ IamInstanceProfile: !If [UseRole, !If [PreRole, !Ref InstanceProfile, !GetAtt MDSRoleStack.Outputs.CMEIAMRole], !Ref 'AWS::NoValue']
KeyName: !Ref KeyName
NetworkInterfaces:
- DeviceIndex: 0
|