From 1418b5cd22159ffa238a18d4295467a9e38eab1a Mon Sep 17 00:00:00 2001 From: Mengxin Zhu <843303+zxkane@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:12:38 +0800 Subject: [PATCH] fix: lookup default sg when using existing vpc --- lib/model-interfaces/idefics/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/model-interfaces/idefics/index.ts b/lib/model-interfaces/idefics/index.ts index a9a1d6b94..1268e4b96 100644 --- a/lib/model-interfaces/idefics/index.ts +++ b/lib/model-interfaces/idefics/index.ts @@ -39,13 +39,13 @@ export class IdeficsInterface extends Construct { // in order to avoid using signed URLs and run out of input tokens // with the idefics model const defaultSecurityGroup = (props.config.vpc?.vpcId && props.config.vpc.vpcDefaultSecurityGroup) ? - props.config.vpc.vpcDefaultSecurityGroup : props.shared.vpc.vpcDefaultSecurityGroup + props.config.vpc.vpcDefaultSecurityGroup : props.shared.vpc.vpcDefaultSecurityGroup; - const vpcDefaultSecurityGroup = ec2.SecurityGroup.fromSecurityGroupId( + const vpcDefaultSecurityGroup = defaultSecurityGroup ? ec2.SecurityGroup.fromSecurityGroupId( this, 'VPCDefaultSecurityGroup', defaultSecurityGroup - ); + ) : ec2.SecurityGroup.fromLookupByName(this, 'VPCDefaultSecurityGroup', 'default', props.shared.vpc); const vpcEndpoint = props.shared.vpc.addInterfaceEndpoint( "PrivateApiEndpoint",