@@ -62,6 +62,10 @@ Parameters:
62
62
Description : ' Prefix applied to the name of every IAM role and policy (max length: 10). [ParallelCluster >= 3.8.0]'
63
63
Default : ' '
64
64
MaxLength : 10
65
+ CustomDomain :
66
+ Type : String
67
+ Description : (Optional) Custom domain name. If omitted, the default domain name will be used.
68
+ Default : ' '
65
69
Metadata :
66
70
AWS::CloudFormation::Interface :
67
71
ParameterGroups :
@@ -100,6 +104,10 @@ Metadata:
100
104
- IAMRoleAndPolicyPrefix
101
105
- PermissionsBoundaryPolicy
102
106
- PermissionsBoundaryPolicyPCAPI
107
+ - Label :
108
+ default : (Optional) Custom Domain
109
+ Parameters :
110
+ - CustomDomain
103
111
- Label :
104
112
default : (Debugging only) Infrastructure S3 Bucket
105
113
Parameters :
@@ -144,11 +152,13 @@ Conditions:
144
152
UsePermissionBoundary : !Not [!Equals [!Ref PermissionsBoundaryPolicy, '']]
145
153
UsePermissionBoundaryPCAPI : !Not [!Equals [!Ref PermissionsBoundaryPolicyPCAPI, '']]
146
154
UseIAMRoleAndPolicyPrefix : !Not [!Equals [!Ref IAMRoleAndPolicyPrefix, '']]
155
+ UseCustomDomain : !Not [!Equals [!Ref CustomDomain, '']]
147
156
148
157
Mappings :
149
158
ParallelClusterUI :
150
159
Constants :
151
160
Version : 2024.07.1 # format YYYY.MM.REVISION
161
+ CustomDomainBasePath : pcui
152
162
153
163
Resources :
154
164
@@ -219,13 +229,22 @@ Resources:
219
229
Variables :
220
230
API_BASE_URL : !GetAtt [ ParallelClusterApi, Outputs.ParallelClusterApiInvokeUrl ]
221
231
API_VERSION : !Ref Version
222
- SITE_URL : !Sub
223
- - https://${Api}.execute-api.${AWS::Region}.${AWS::URLSuffix}/pcui
224
- - Api : !Ref ApiGatewayRestApi
232
+ SITE_URL : !If
233
+ - UseCustomDomain
234
+ - !Sub
235
+ - https://${CustomDomain}/${CustomDomainBasePath}
236
+ - { CustomDomainBasePath: !FindInMap [ ParallelClusterUI, Constants, CustomDomainBasePath ] }
237
+ - !Sub
238
+ - https://${Api}.execute-api.${AWS::Region}.${AWS::URLSuffix}/${Stage}
239
+ - { Api: !Ref ApiGatewayRestApi, Stage: !Ref ApiGatewayRestStage }
225
240
AUTH_PATH : !If [ UseExistingCognito, !Ref UserPoolAuthDomain, !GetAtt [ Cognito, Outputs.UserPoolAuthDomain ]]
226
241
SECRET_ID : !GetAtt UserPoolClientSecret.SecretName
227
242
AUDIENCE : !Ref CognitoAppClient
228
243
OIDC_PROVIDER : ' Cognito'
244
+ API_GATEWAY_BASE_PATH : !If
245
+ - UseCustomDomain
246
+ - !FindInMap [ ParallelClusterUI, Constants, CustomDomainBasePath ]
247
+ - !Ref AWS::NoValue
229
248
FunctionName : !Sub
230
249
- ParallelClusterUIFun-${StackIdSuffix}
231
250
- { StackIdSuffix: !Select [2, !Split ['/', !Ref 'AWS::StackId']] }
@@ -351,7 +370,7 @@ Resources:
351
370
Format : ' { "requestId":"$context.requestId", "ip": "$context.identity.sourceIp", "requestTime":"$context.requestTime", "httpMethod":"$context.httpMethod","path":"$context.path", "status":"$context.status","protocol":"$context.protocol", "responseLength":"$context.responseLength" }'
352
371
RestApiId : !Ref ApiGatewayRestApi
353
372
DeploymentId : !Ref ApiGatewayDeployment
354
- StageName : pcui
373
+ StageName : !If [ UseCustomDomain, prod, pcui ]
355
374
MethodSettings :
356
375
- ResourcePath : ' /*'
357
376
HttpMethod : ' *'
@@ -371,9 +390,14 @@ Resources:
371
390
ExplicitAuthFlows :
372
391
- ALLOW_REFRESH_TOKEN_AUTH
373
392
CallbackURLs :
374
- - !Sub
375
- - https://${Api}.execute-api.${AWS::Region}.${AWS::URLSuffix}/pcui/login
376
- - Api : !Ref ApiGatewayRestApi
393
+ - !If
394
+ - UseCustomDomain
395
+ - !Sub
396
+ - https://${CustomDomain}/${CustomDomainBasePath}/login
397
+ - { CustomDomainBasePath: !FindInMap [ ParallelClusterUI, Constants, CustomDomainBasePath ] }
398
+ - !Sub
399
+ - https://${Api}.execute-api.${AWS::Region}.${AWS::URLSuffix}/${Stage}/login
400
+ - { Api: !Ref ApiGatewayRestApi, Stage: !Ref ApiGatewayRestStage }
377
401
SupportedIdentityProviders :
378
402
- COGNITO
379
403
UserPoolId : !If [ UseExistingCognito, !Ref UserPoolId, !GetAtt [ Cognito, Outputs.UserPoolId ]]
@@ -1011,9 +1035,14 @@ Outputs:
1011
1035
Description : ' Url to reach the ParallelCluster UI Site.'
1012
1036
Export :
1013
1037
Name : !Sub ${AWS::StackName}-ParallelClusterUISite
1014
- Value : !Sub
1015
- - https://${Api}.execute-api.${AWS::Region}.${AWS::URLSuffix}/pcui
1016
- - Api : !Ref ApiGatewayRestApi
1038
+ Value : !If
1039
+ - UseCustomDomain
1040
+ - !Sub
1041
+ - https://${CustomDomain}/${CustomDomainBasePath}
1042
+ - { CustomDomainBasePath: !FindInMap [ ParallelClusterUI, Constants, CustomDomainBasePath ] }
1043
+ - !Sub
1044
+ - https://${Api}.execute-api.${AWS::Region}.${AWS::URLSuffix}/${Stage}
1045
+ - { Api: !Ref ApiGatewayRestApi, Stage: !Ref ApiGatewayRestStage }
1017
1046
AppClientId :
1018
1047
Description : The id of the Cognito app client
1019
1048
Value : !Ref CognitoAppClient
0 commit comments