Skip to content

Commit

Permalink
Adding subnet for ec2 create instance call and updating docker file p…
Browse files Browse the repository at this point in the history
…erms
  • Loading branch information
estohlmann authored Nov 19, 2024
1 parent bb0667e commit 60e56f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions ecs_model_deployer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM public.ecr.aws/lambda/nodejs:18

COPY ./dist/ ${LAMBDA_TASK_ROOT}
RUN chmod 777 -R ${LAMBDA_TASK_ROOT}
CMD ["index.handler"]
1 change: 1 addition & 0 deletions lambda/dockerimagebuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def handler(event: Dict[str, Any], context) -> Dict[str, Any]: # type: ignore [
try:
instances = ec2_resource.create_instances(
ImageId=ami_id,
SubnetId=os.environ["LISA_SUBNET_ID"],
MinCount=1,
MaxCount=1,
InstanceType="m5.large",
Expand Down
3 changes: 2 additions & 1 deletion lib/models/docker-image-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ export class DockerImageBuilder extends Construct {
'LISA_DOCKER_BUCKET': ec2DockerBucket.bucketName,
'LISA_ECR_URI': props.ecrUri,
'LISA_INSTANCE_PROFILE': ec2InstanceProfile.instanceProfileArn,
'LISA_MOUNTS3_DEB_URL': props.mountS3DebUrl
'LISA_MOUNTS3_DEB_URL': props.mountS3DebUrl,
...(props.config?.subnets && {'LISA_SUBNET_ID': props.config.subnets[0].subnetId})
},
vpc: props.vpc?.subnetSelection ? props.vpc?.vpc : undefined,
vpcSubnets: props.vpc?.subnetSelection,
Expand Down

0 comments on commit 60e56f3

Please sign in to comment.