Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create SageMaker and StepFunctions endpoints when not needed #511

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Contributor

Choose a reason for hiding this comment

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

does this account for the fact that the re-ranker endpoint is always running when rag is enabled? even if no specific sagemaker models are chosen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that should be the reason

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