Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions lib/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ export class Shared extends Construct {
});

// Create VPC Endpoint for SageMaker Runtime
vpc.addInterfaceEndpoint("SageMakerRuntimeEndpoint", {
service: ec2.InterfaceVpcEndpointAwsService.SAGEMAKER_RUNTIME,
open: true,
});
if (props.config.llms.sagemaker.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (props.config.llms.sagemaker.length > 0) {
if (props.config.llms.sagemaker.length > 0 || props.config.rag.enabled) {

At this time, If rag is enabled, it will automatically create a sagemaker endpoint for embedding/cross encoding regardless of the config. (unless I am mistaken?)

vpc.addInterfaceEndpoint("SageMakerRuntimeEndpoint", {
service: ec2.InterfaceVpcEndpointAwsService.SAGEMAKER_RUNTIME,
open: true,
});
}

if (props.config.privateWebsite) {
// Create VPC Endpoint for AppSync
Expand All @@ -129,10 +131,11 @@ export class Shared extends Construct {
service: ec2.InterfaceVpcEndpointAwsService.SNS,
});

// Create VPC Endpoint for Step Functions
vpc.addInterfaceEndpoint("StepFunctionsEndpoint", {
service: ec2.InterfaceVpcEndpointAwsService.STEP_FUNCTIONS,
});
if (props.config.rag.enabled) {
vpc.addInterfaceEndpoint("StepFunctionsEndpoint", {
service: ec2.InterfaceVpcEndpointAwsService.STEP_FUNCTIONS,
});
}

// Create VPC Endpoint for SSM
vpc.addInterfaceEndpoint("SSMEndpoint", {
Expand Down
Loading