diff --git a/ecs_model_deployer/Dockerfile b/ecs_model_deployer/Dockerfile index 80375d26..5cdf25f5 100644 --- a/ecs_model_deployer/Dockerfile +++ b/ecs_model_deployer/Dockerfile @@ -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"] diff --git a/lambda/dockerimagebuilder/__init__.py b/lambda/dockerimagebuilder/__init__.py index 75ccda4f..dcda9f06 100644 --- a/lambda/dockerimagebuilder/__init__.py +++ b/lambda/dockerimagebuilder/__init__.py @@ -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", diff --git a/lib/models/docker-image-builder.ts b/lib/models/docker-image-builder.ts index 98c05bd9..d7b2cc3d 100644 --- a/lib/models/docker-image-builder.ts +++ b/lib/models/docker-image-builder.ts @@ -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,