Skip to content

Commit 421b80a

Browse files
committed
fix: rename ALBHOSTINGSTACK to match convention, fix CLI comma-delimited parameter parsing
1 parent 92d2704 commit 421b80a

2 files changed

Lines changed: 27 additions & 19 deletions

File tree

lib/idp_cli_pkg/idp_cli/cli.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,18 @@ def deploy(
440440
# Parse additional parameters
441441
additional_params = {}
442442
if parameters:
443-
for param in parameters.split(","):
444-
if "=" in param:
445-
key, value = param.split("=", 1)
446-
additional_params[key.strip()] = value.strip()
443+
# Parse key=value pairs separated by commas, but handle values
444+
# that themselves contain commas (e.g., subnet lists).
445+
# Strategy: split on commas that are followed by a key= pattern.
446+
import re
447+
448+
for match in re.finditer(
449+
r"([A-Za-z][A-Za-z0-9]*)=((?:(?![A-Za-z][A-Za-z0-9]*=).)*)",
450+
parameters,
451+
):
452+
key = match.group(1).strip()
453+
value = match.group(2).strip().rstrip(",")
454+
additional_params[key] = value
447455

448456
# Deploy stack via SDK (build_parameters is called internally by client.stack.deploy)
449457
# Debug: show custom config path hint before deploy

template.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ Resources:
16811681
- !If
16821682
- UseCloudFrontHosting
16831683
- !Sub "https://${CloudFrontDistribution.DomainName}"
1684-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
1684+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
16851685
# For local development only
16861686
- "http://localhost:3000"
16871687
ExposedHeaders:
@@ -1753,7 +1753,7 @@ Resources:
17531753
- !If
17541754
- UseCloudFrontHosting
17551755
- !Sub "https://${CloudFrontDistribution.DomainName}"
1756-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
1756+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
17571757
# For local development only
17581758
- "http://localhost:3000"
17591759
ExposedHeaders:
@@ -1821,7 +1821,7 @@ Resources:
18211821
- !If
18221822
- UseCloudFrontHosting
18231823
- !Sub "https://${CloudFrontDistribution.DomainName}"
1824-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
1824+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
18251825
# For local development only
18261826
- "http://localhost:3000"
18271827
ExposedHeaders:
@@ -2270,7 +2270,7 @@ Resources:
22702270
- !If
22712271
- UseCloudFrontHosting
22722272
- !Sub "https://${CloudFrontDistribution.DomainName}"
2273-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
2273+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
22742274
# For local development only
22752275
- "http://localhost:3000"
22762276
ExposedHeaders:
@@ -2385,7 +2385,7 @@ Resources:
23852385
- !If
23862386
- UseCloudFrontHosting
23872387
- !Sub "https://${CloudFrontDistribution.DomainName}"
2388-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
2388+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
23892389
# For local development only
23902390
- "http://localhost:3000"
23912391
ExposedHeaders:
@@ -2454,7 +2454,7 @@ Resources:
24542454
- !If
24552455
- UseCloudFrontHosting
24562456
- !Sub "https://${CloudFrontDistribution.DomainName}"
2457-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
2457+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
24582458
# For local development only
24592459
- "http://localhost:3000"
24602460
ExposedHeaders:
@@ -2908,7 +2908,7 @@ Resources:
29082908
- !If
29092909
- UseCloudFrontHosting
29102910
- !Sub "https://${CloudFrontDistribution.DomainName}"
2911-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
2911+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
29122912
# For local development only
29132913
- "http://localhost:3000"
29142914
ExposedHeaders:
@@ -3005,7 +3005,7 @@ Resources:
30053005
Resource: !Sub "${WebUIBucket.Arn}/*"
30063006
Condition:
30073007
StringEquals:
3008-
"aws:sourceVpce": !GetAtt ALBHostingStack.Outputs.S3VPCEndpointId
3008+
"aws:sourceVpce": !GetAtt ALBHOSTINGSTACK.Outputs.S3VPCEndpointId
30093009
- !Ref AWS::NoValue
30103010
- Effect: "Deny"
30113011
Action:
@@ -5429,7 +5429,7 @@ Resources:
54295429
- !If
54305430
- UseCloudFrontHosting
54315431
- !Sub "https://${CloudFrontDistribution.DomainName}/"
5432-
- !Sub "${ALBHostingStack.Outputs.WebUIURL}/"
5432+
- !Sub "${ALBHOSTINGSTACK.Outputs.WebUIURL}/"
54335433
- !Sub "https://${AWS::Region}.quicksight.aws.amazon.com/sn/oauthcallback"
54345434
- https://us-east-1.quicksight.aws.amazon.com/sn/oauthcallback
54355435
- https://us-west-2.quicksight.aws.amazon.com/sn/oauthcallback
@@ -5440,7 +5440,7 @@ Resources:
54405440
- !If
54415441
- UseCloudFrontHosting
54425442
- !Sub "https://${CloudFrontDistribution.DomainName}/"
5443-
- !Sub "${ALBHostingStack.Outputs.WebUIURL}/"
5443+
- !Sub "${ALBHOSTINGSTACK.Outputs.WebUIURL}/"
54445444
- !Sub "https://${AWS::Region}.quicksight.aws.amazon.com/sn/oauthcallback"
54455445
- https://us-east-1.quicksight.aws.amazon.com/sn/oauthcallback
54465446
- https://us-west-2.quicksight.aws.amazon.com/sn/oauthcallback
@@ -5481,7 +5481,7 @@ Resources:
54815481
- WebUIURL: !If
54825482
- UseCloudFrontHosting
54835483
- !Sub "https://${CloudFrontDistribution.DomainName}/"
5484-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
5484+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
54855485
AutoVerifiedAttributes:
54865486
- email
54875487
EmailConfiguration:
@@ -5527,7 +5527,7 @@ Resources:
55275527
- !If
55285528
- UseCloudFrontHosting
55295529
- !Sub "https://${CloudFrontDistribution.DomainName}"
5530-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
5530+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
55315531
AccessTokenValidity: 1
55325532
EnableTokenRevocation: true
55335533
ExplicitAuthFlows:
@@ -6653,7 +6653,7 @@ Resources:
66536653
# ALB Hosting (alternative to CloudFront for GovCloud / private networks)
66546654
##########################################################################
66556655

6656-
ALBHostingStack:
6656+
ALBHOSTINGSTACK:
66576657
Type: AWS::CloudFormation::Stack
66586658
Condition: UseALBHosting
66596659
Properties:
@@ -6823,7 +6823,7 @@ Resources:
68236823
Value: !If
68246824
- UseCloudFrontHosting
68256825
- !Sub "https://${CloudFrontDistribution.DomainName}/"
6826-
- !Sub "${ALBHostingStack.Outputs.WebUIURL}/"
6826+
- !Sub "${ALBHOSTINGSTACK.Outputs.WebUIURL}/"
68276827
- Name: VITE_TEST_SET_BUCKET_NAME
68286828
Value: !Ref TestSetBucket
68296829
- Name: VITE_INPUT_BUCKET_NAME
@@ -7252,7 +7252,7 @@ Outputs:
72527252
Value: !If
72537253
- UseCloudFrontHosting
72547254
- !Sub "https://${CloudFrontDistribution.DomainName}/"
7255-
- !GetAtt ALBHostingStack.Outputs.WebUIURL
7255+
- !GetAtt ALBHOSTINGSTACK.Outputs.WebUIURL
72567256
S3InstallBucket:
72577257
Description: Install S3 bucket name
72587258
Value: !Ref InputBucket

0 commit comments

Comments
 (0)