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

Dealing with existant VPC for IdeficsInterface deployment #498

Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions bin/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export function getConfig(): SystemConfig {
/* vpc: {
vpcId: "vpc-00000000000000000",
createVpcEndpoints: true,
vpcDefaultSecurityGroup: "sg-00000000000"
},*/
privateWebsite: false,
certificate : "",
Expand Down
9 changes: 6 additions & 3 deletions lib/model-interfaces/idefics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ export class IdeficsInterface extends Construct {
// Create a private API to serve images and other files from S3
// 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

const vpcDefaultSecurityGroup = ec2.SecurityGroup.fromSecurityGroupId(
this,
"VPCDefaultSecurityGroup",
props.shared.vpc.vpcDefaultSecurityGroup
this,
'VPCDefaultSecurityGroup',
defaultSecurityGroup
);

const vpcEndpoint = props.shared.vpc.addInterfaceEndpoint(
Expand Down
1 change: 1 addition & 0 deletions lib/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export interface SystemConfig {
vpc?: {
vpcId?: string;
createVpcEndpoints?: boolean;
vpcDefaultSecurityGroup?: string;
};
certificate?: string;
domain?: string;
Expand Down
Loading