Skip to content

Commit fd716b1

Browse files
Enrico Usaienrico-usai
authored andcommitted
Add missing condition for MasterPublicIp Output
The Master Public IP from the MasterServer resource is only available if MasterPublicIp condition is verified. We lost this condition when created two substacks for the master and the computes. Signed-off-by: Enrico Usai <[email protected]>
1 parent ef2996d commit fd716b1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

cloudformation/aws-parallelcluster.cfn.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2790,6 +2790,13 @@
27902790
"MasterENI": {
27912791
"Ref": "MasterENI"
27922792
},
2793+
"MasterPublicIp": {
2794+
"Fn::If": [
2795+
"MasterPublicIp",
2796+
true,
2797+
false
2798+
]
2799+
},
27932800
"ImageId": {
27942801
"Fn::If": [
27952802
"UseCustomAMI",

cloudformation/master-server-substack.cfn.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Parameters:
2424
Type: String
2525
MasterENI:
2626
Type: String
27+
MasterPublicIp:
28+
Type: String
2729
ImageId:
2830
Type: AWS::EC2::Image::Id
2931
IamInstanceProfile:
@@ -219,6 +221,9 @@ Conditions:
219221
- !Equals
220222
- !Ref 'UpdateWaiterFunctionArn'
221223
- NONE
224+
MasterPublicIp: !Equals
225+
- !Ref 'MasterPublicIp'
226+
- 'true'
222227
Resources:
223228
MasterServer:
224229
Type: AWS::EC2::Instance
@@ -622,6 +627,7 @@ Outputs:
622627
MasterPublicIP:
623628
Description: Public IP Address of the Master host
624629
Value: !GetAtt 'MasterServer.PublicIp'
630+
Condition: MasterPublicIp
625631
MasterPrivateDnsName:
626632
Description: Private DNS name of the Master host
627633
Value: !GetAtt 'MasterServer.PrivateDnsName'

0 commit comments

Comments
 (0)