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",